summaryrefslogtreecommitdiff
path: root/src/node_contextify.cc
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2015-01-07 13:29:58 -0800
committerTrevor Norris <trev.norris@gmail.com>2015-01-07 14:19:40 -0800
commitd55338662329ac37386783ef1aa88f099eff86b2 (patch)
tree0bf70e21e9c99e7d8faf62a28bfc4f0e92fa066b /src/node_contextify.cc
parent6e9d1c868474273b3b5891508c28aa13f70ff465 (diff)
downloadnode-new-d55338662329ac37386783ef1aa88f099eff86b2.tar.gz
src: pass Isolate to additional locations
Due to a recent V8 upgrade, more methods require Isolate as an argument. PR-URL: https://github.com/iojs/io.js/pull/244 Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_contextify.cc')
-rw-r--r--src/node_contextify.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index ead5e3efc3..11712f727a 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -144,7 +144,8 @@ class ContextifyContext {
HandleScope scope(env()->isolate());
Local<Context> context = PersistentToLocal(env()->isolate(), context_);
- Local<Object> global = context->Global()->GetPrototype()->ToObject();
+ Local<Object> global =
+ context->Global()->GetPrototype()->ToObject(env()->isolate());
Local<Object> sandbox = PersistentToLocal(env()->isolate(), sandbox_);
Local<Function> clone_property_method;
@@ -152,7 +153,7 @@ class ContextifyContext {
Local<Array> names = global->GetOwnPropertyNames();
int length = names->Length();
for (int i = 0; i < length; i++) {
- Local<String> key = names->Get(i)->ToString();
+ Local<String> key = names->Get(i)->ToString(env()->isolate());
bool has = sandbox->HasOwnProperty(key);
if (!has) {
// Could also do this like so:
@@ -253,7 +254,7 @@ class ContextifyContext {
static void RunInDebugContext(const FunctionCallbackInfo<Value>& args) {
- Local<String> script_source(args[0]->ToString());
+ Local<String> script_source(args[0]->ToString(args.GetIsolate()));
if (script_source.IsEmpty())
return; // Exception pending.
Context::Scope context_scope(Debug::GetDebugContext());
@@ -476,7 +477,7 @@ class ContextifyScript : public BaseObject {
new ContextifyScript(env, args.This());
TryCatch try_catch;
- Local<String> code = args[0]->ToString();
+ Local<String> code = args[0]->ToString(env->isolate());
Local<String> filename = GetFilenameArg(args, 1);
bool display_errors = GetDisplayErrorsArg(args, 1);
if (try_catch.HasCaught()) {
@@ -643,7 +644,9 @@ class ContextifyScript : public BaseObject {
Local<String> key = FIXED_ONE_BYTE_STRING(args.GetIsolate(), "filename");
Local<Value> value = args[i].As<Object>()->Get(key);
- return value->IsUndefined() ? defaultFilename : value->ToString();
+ if (value->IsUndefined())
+ return defaultFilename;
+ return value->ToString(args.GetIsolate());
}