mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add Dictionary::CreateEmpty
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user