Add SetHidden for Dictionary
This commit is contained in:
parent
b41635e809
commit
f5e34deb1a
1 changed files with 13 additions and 0 deletions
|
@ -36,12 +36,25 @@ class Dictionary {
|
||||||
return ConvertFromV8(isolate_, val, out);
|
return ConvertFromV8(isolate_, val, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool GetHidden(const base::StringPiece& key, T* out) const {
|
||||||
|
v8::Local<v8::Value> val = GetHandle()->GetHiddenValue(
|
||||||
|
StringToV8(isolate_, key));
|
||||||
|
return ConvertFromV8(isolate_, val, out);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Set(const base::StringPiece& key, T val) {
|
bool Set(const base::StringPiece& key, T val) {
|
||||||
return GetHandle()->Set(StringToV8(isolate_, key),
|
return GetHandle()->Set(StringToV8(isolate_, key),
|
||||||
ConvertToV8(isolate_, val));
|
ConvertToV8(isolate_, val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool SetHidden(const base::StringPiece& key, T val) {
|
||||||
|
return GetHandle()->SetHiddenValue(StringToV8(isolate_, key),
|
||||||
|
ConvertToV8(isolate_, val));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool SetMethod(const base::StringPiece& key, const T& callback) {
|
bool SetMethod(const base::StringPiece& key, const T& callback) {
|
||||||
return GetHandle()->Set(
|
return GetHandle()->Set(
|
||||||
|
|
Loading…
Reference in a new issue