Use new context aware module API in builtin modules.

This commit is contained in:
Cheng Zhao 2014-06-29 20:48:44 +08:00
parent c3301a197e
commit ba46f2c820
16 changed files with 64 additions and 49 deletions

View file

@ -43,8 +43,9 @@ void TakeHeapSnapshot(v8::Isolate* isolate) {
mate::StringToV8(isolate, "test"));
}
void Initialize(v8::Handle<v8::Object> exports) {
mate::Dictionary dict(v8::Isolate::GetCurrent(), exports);
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("createObjectWithName", &CreateObjectWithName);
dict.SetMethod("getHiddenValue", &GetHiddenValue);
dict.SetMethod("setHiddenValue", &SetHiddenValue);
@ -55,4 +56,4 @@ void Initialize(v8::Handle<v8::Object> exports) {
} // namespace
NODE_MODULE_X(atom_common_v8_util, Initialize, NULL, NM_F_BUILTIN)
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_v8_util, Initialize)