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

@ -262,9 +262,10 @@ void Menu::BuildPrototype(v8::Isolate* isolate,
namespace {
void Initialize(v8::Handle<v8::Object> exports) {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
using atom::api::Menu;
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::Function> constructor = mate::CreateConstructor<Menu>(
isolate, "Menu", base::Bind(&Menu::Create));
mate::Dictionary dict(isolate, exports);
@ -278,4 +279,4 @@ void Initialize(v8::Handle<v8::Object> exports) {
} // namespace
NODE_MODULE_X(atom_browser_menu, Initialize, NULL, NM_F_BUILTIN)
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_menu, Initialize)