Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
use current module for "require" access
Browse files Browse the repository at this point in the history
fix #30
  • Loading branch information
RSATom committed Aug 2, 2015
1 parent 00e05c2 commit 5a6d93e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NodeTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ v8::Local<v8::Function> RequireFunc()
using namespace v8;

Isolate* isolate = Isolate::GetCurrent();
Local<Object> global = isolate->GetCurrentContext()->Global();
Local<Object> module = Local<Object>::New( Isolate::GetCurrent(), ::thisModule );

return
Local<Function>::Cast(
global->Get(
module->Get(
String::NewFromUtf8( isolate,
"require",
String::kInternalizedString ) ) );
Expand Down

0 comments on commit 5a6d93e

Please sign in to comment.