diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index ac6d6ba738cf75..3d806d71ef9204 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -230,7 +230,7 @@ static void AsyncTaskScheduledWrapper(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); Local task_name = args[0].As(); - String::Value task_name_value(task_name); + String::Value task_name_value(args.GetIsolate(), task_name); StringView task_name_view(*task_name_value, task_name_value.length()); CHECK(args[1]->IsNumber()); diff --git a/src/node.cc b/src/node.cc index e7dd6669347032..8dfefcae6ecdfb 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1269,9 +1269,11 @@ void AppendExceptionLine(Environment* env, ScriptOrigin origin = message->GetScriptOrigin(); node::Utf8Value filename(env->isolate(), message->GetScriptResourceName()); const char* filename_string = *filename; - int linenum = message->GetLineNumber(); + int linenum = message->GetLineNumber(env->context()).FromJust(); // Print line of source code. - node::Utf8Value sourceline(env->isolate(), message->GetSourceLine()); + MaybeLocal source_line_maybe = message->GetSourceLine(env->context()); + node::Utf8Value sourceline(env->isolate(), + source_line_maybe.ToLocalChecked()); const char* sourceline_string = *sourceline; if (strstr(sourceline_string, "node-do-not-add-exception-line") != nullptr) return; @@ -1419,7 +1421,7 @@ static void ReportException(Environment* env, name.IsEmpty() || name->IsUndefined()) { // Not an error object. Just print as-is. - String::Utf8Value message(er); + String::Utf8Value message(env->isolate(), er); PrintErrorString("%s\n", *message ? *message : ""); @@ -1471,13 +1473,13 @@ static Local ExecuteString(Environment* env, exit(3); } - Local result = script.ToLocalChecked()->Run(); + MaybeLocal result = script.ToLocalChecked()->Run(env->context()); if (result.IsEmpty()) { ReportException(env, try_catch); exit(4); } - return scope.Escape(result); + return scope.Escape(result.ToLocalChecked()); } diff --git a/src/node_api.cc b/src/node_api.cc index 16e0a3e18b4fc3..3769de6c98b21b 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -3315,7 +3315,7 @@ class Work : public node::AsyncResource { void* data = nullptr) : AsyncResource(env->isolate, async_resource, - *v8::String::Utf8Value(async_resource_name)), + *v8::String::Utf8Value(env->isolate, async_resource_name)), _env(env), _data(data), _execute(execute), diff --git a/src/node_buffer.cc b/src/node_buffer.cc index c25fe11b5a4c6a..15e6c7a0c492d3 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -854,7 +854,7 @@ void IndexOfString(const FunctionCallbackInfo& args) { size_t result = haystack_length; if (enc == UCS2) { - String::Value needle_value(needle); + String::Value needle_value(args.GetIsolate(), needle); if (*needle_value == nullptr) return args.GetReturnValue().Set(-1); @@ -887,7 +887,7 @@ void IndexOfString(const FunctionCallbackInfo& args) { } result *= 2; } else if (enc == UTF8) { - String::Utf8Value needle_value(needle); + String::Utf8Value needle_value(args.GetIsolate(), needle); if (*needle_value == nullptr) return args.GetReturnValue().Set(-1); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index a7f46f61269e2b..b5f0fd14f280f4 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1088,21 +1088,21 @@ class ContextifyScript : public BaseObject { PersistentToLocal(env->isolate(), wrapped_script->script_); Local