diff options
author | Gus Caplan <me@gus.host> | 2018-11-30 17:13:45 +0300 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-12-03 19:25:06 +0300 |
commit | f084e06de7b03750a80925a7aa1aefe3aed47504 (patch) | |
tree | a014956efe76cd2c1273811eb5efd4d30f784b94 /src/node_contextify.cc | |
parent | dbdc9081fa723f62126ef857ee9365425e41dd9f (diff) |
src: use custom TryCatch subclass
PR-URL: https://github.com/nodejs/node/pull/24751
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_contextify.cc')
-rw-r--r-- | src/node_contextify.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc index bc08e31a065..f12d5e7d667 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -31,6 +31,8 @@ namespace node { namespace contextify { +using errors::TryCatchScope; + using v8::Array; using v8::ArrayBuffer; using v8::ArrayBufferView; @@ -63,7 +65,6 @@ using v8::ScriptCompiler; using v8::ScriptOrigin; using v8::String; using v8::Symbol; -using v8::TryCatch; using v8::Uint32; using v8::UnboundScript; using v8::Value; @@ -245,7 +246,7 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) { CHECK(args[4]->IsBoolean()); options.allow_code_gen_wasm = args[4].As<Boolean>(); - TryCatch try_catch(env->isolate()); + TryCatchScope try_catch(env); ContextifyContext* context = new ContextifyContext(env, sandbox, options); if (try_catch.HasCaught()) { @@ -705,7 +706,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { if (source.GetCachedData() != nullptr) compile_options = ScriptCompiler::kConsumeCodeCache; - TryCatch try_catch(isolate); + TryCatchScope try_catch(env); Environment::ShouldNotAbortOnUncaughtScope no_abort_scope(env); Context::Scope scope(parsing_context); @@ -863,7 +864,7 @@ bool ContextifyScript::EvalMachine(Environment* env, "Script methods can only be called on script instances."); return false; } - TryCatch try_catch(env->isolate()); + TryCatchScope try_catch(env); ContextifyScript* wrapped_script; ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.Holder(), false); Local<UnboundScript> unbound_script = @@ -1012,7 +1013,7 @@ void ContextifyContext::CompileFunction( options = ScriptCompiler::kConsumeCodeCache; } - TryCatch try_catch(isolate); + TryCatchScope try_catch(env); Context::Scope scope(parsing_context); // Read context extensions from buffer |