mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Don't conflict with V8's Script class
Closes GH-203.
This commit is contained in:
1 parent
4cc0a0878f
commit
75db1995b6
4 files changed
+12
-9
No files matched your search
+5
-2
@@ -150,7 +150,10 @@ void WrappedScript::Initialize(Handle<Object> target) {
|
||||
Local<FunctionTemplate> t = FunctionTemplate::New(WrappedScript::New);
|
||||
constructor_template = Persistent<FunctionTemplate>::New(t);
|
||||
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
|
||||
constructor_template->SetClassName(String::NewSymbol("Script"));
|
||||
// Note: We use 'NodeScript' instead of 'Script' so that we do not
|
||||
// conflict with V8's Script class defined in v8/src/messages.js
|
||||
// See GH-203 https://github.com/joyent/node/issues/203
|
||||
constructor_template->SetClassName(String::NewSymbol("NodeScript"));
|
||||
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor_template,
|
||||
"createContext",
|
||||
@@ -184,7 +187,7 @@ void WrappedScript::Initialize(Handle<Object> target) {
|
||||
"runInNewContext",
|
||||
WrappedScript::CompileRunInNewContext);
|
||||
|
||||
target->Set(String::NewSymbol("Script"),
|
||||
target->Set(String::NewSymbol("NodeScript"),
|
||||
constructor_template->GetFunction());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user