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);
|
||||
}
|
||||
|
||||
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>
|
||||
bool Set(const base::StringPiece& key, T val) {
|
||||
return GetHandle()->Set(StringToV8(isolate_, key),
|
||||
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>
|
||||
bool SetMethod(const base::StringPiece& key, const T& callback) {
|
||||
return GetHandle()->Set(
|
||||
|
|
Loading…
Reference in a new issue