From 51a55810b95ac4153a133ef278031a04cc6fcada Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 Jun 2014 21:38:46 +0800 Subject: [PATCH] Enable creating empty Dictionary directly. --- native_mate/dictionary.cc | 3 ++- native_mate/dictionary.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/native_mate/dictionary.cc b/native_mate/dictionary.cc index 1504f683f0a7..88bdefb1f794 100644 --- a/native_mate/dictionary.cc +++ b/native_mate/dictionary.cc @@ -7,7 +7,8 @@ namespace mate { Dictionary::Dictionary(v8::Isolate* isolate) - : isolate_(isolate) { + : isolate_(isolate), + object_(v8::Object::New()) { } Dictionary::Dictionary(v8::Isolate* isolate, diff --git a/native_mate/dictionary.h b/native_mate/dictionary.h index 563916e45980..333bae0f7a5f 100644 --- a/native_mate/dictionary.h +++ b/native_mate/dictionary.h @@ -24,7 +24,7 @@ namespace mate { // class Dictionary { public: - explicit Dictionary(v8::Isolate* isolate = NULL); + Dictionary(v8::Isolate* isolate = v8::Isolate::GetCurrent()); Dictionary(v8::Isolate* isolate, v8::Handle object); ~Dictionary();