From 023c317173ff305e4df69d18796745cb641996c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 8 Feb 2016 22:34:05 +0100 Subject: [PATCH] src: replace usage of deprecated Compile PR-URL: https://github.com/nodejs/node/pull/5159 Reviewed-By: Ben Noordhuis --- src/node.cc | 8 ++++++-- src/node_contextify.cc | 9 ++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/node.cc b/src/node.cc index 35ca49451a400a..a736e22d0fa376 100644 --- a/src/node.cc +++ b/src/node.cc @@ -115,6 +115,7 @@ using v8::Integer; using v8::Isolate; using v8::Local; using v8::Locker; +using v8::MaybeLocal; using v8::Message; using v8::Number; using v8::Object; @@ -122,6 +123,7 @@ using v8::ObjectTemplate; using v8::Promise; using v8::PromiseRejectMessage; using v8::PropertyCallbackInfo; +using v8::ScriptOrigin; using v8::SealHandleScope; using v8::StackFrame; using v8::StackTrace; @@ -1610,13 +1612,15 @@ static Local ExecuteString(Environment* env, // we will handle exceptions ourself. try_catch.SetVerbose(false); - Local script = v8::Script::Compile(source, filename); + ScriptOrigin origin(filename); + MaybeLocal script = + v8::Script::Compile(env->context(), source, &origin); if (script.IsEmpty()) { ReportException(env, try_catch); exit(3); } - Local result = script->Run(); + Local result = script.ToLocalChecked()->Run(); if (result.IsEmpty()) { ReportException(env, try_catch); exit(4); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index ade8f4379c2bdb..f7ddf866b206f4 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -167,9 +167,8 @@ class ContextifyContext { " }\n" "})"); - Local fname = FIXED_ONE_BYTE_STRING(env()->isolate(), - "binding:script"); - Local