Add Dictionary::CreateEmpty
This commit is contained in:
Родитель
67d9eaa215
Коммит
b6c353ee80
|
@ -19,6 +19,10 @@ Dictionary::Dictionary(v8::Isolate* isolate,
|
|||
Dictionary::~Dictionary() {
|
||||
}
|
||||
|
||||
Dictionary Dictionary::CreateEmpty(v8::Isolate* isolate) {
|
||||
return Dictionary(isolate, v8::Object::New(isolate));;
|
||||
}
|
||||
|
||||
v8::Local<v8::Object> Dictionary::GetHandle() const {
|
||||
return object_;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ class Dictionary {
|
|||
Dictionary(v8::Isolate* isolate, v8::Local<v8::Object> object);
|
||||
~Dictionary();
|
||||
|
||||
static Dictionary CreateEmpty(v8::Isolate* isolate);
|
||||
|
||||
template<typename T>
|
||||
bool Get(const base::StringPiece& key, T* out) const {
|
||||
v8::Local<v8::Value> val = GetHandle()->Get(StringToV8(isolate_, key));
|
||||
|
|
Загрузка…
Ссылка в новой задаче