diff options
author | Shelley Vohr <shelley.vohr@gmail.com> | 2020-10-06 02:16:59 +0300 |
---|---|---|
committer | Shelley Vohr <shelley.vohr@gmail.com> | 2020-10-08 04:32:53 +0300 |
commit | ccc822c7c8f4a205323231b000b7920d8a04cb26 (patch) | |
tree | 2e4521e3cb1570c4c493032e4213c780fcb58769 /src/api | |
parent | dae283d96fd31ad0f30840a7e55ac97294f505ac (diff) |
src: expose v8::Isolate setup callbacks
PR-URL: https://github.com/nodejs/node/pull/35512
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/environment.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc index 65ee6020933..fa994bc41ec 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -31,14 +31,14 @@ using v8::SealHandleScope; using v8::String; using v8::Value; -static bool AllowWasmCodeGenerationCallback(Local<Context> context, - Local<String>) { +bool AllowWasmCodeGenerationCallback(Local<Context> context, + Local<String>) { Local<Value> wasm_code_gen = context->GetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration); return wasm_code_gen->IsUndefined() || wasm_code_gen->IsTrue(); } -static bool ShouldAbortOnUncaughtException(Isolate* isolate) { +bool ShouldAbortOnUncaughtException(Isolate* isolate) { DebugSealHandleScope scope(isolate); Environment* env = Environment::GetCurrent(isolate); return env != nullptr && @@ -48,9 +48,9 @@ static bool ShouldAbortOnUncaughtException(Isolate* isolate) { !env->inside_should_not_abort_on_uncaught_scope(); } -static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context, - Local<Value> exception, - Local<Array> trace) { +MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context, + Local<Value> exception, + Local<Array> trace) { Environment* env = Environment::GetCurrent(context); if (env == nullptr) { return exception->ToString(context).FromMaybe(Local<Value>()); @@ -245,7 +245,7 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) { if ((s.flags & SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK) == 0) { auto* promise_reject_cb = s.promise_reject_callback ? - s.promise_reject_callback : task_queue::PromiseRejectCallback; + s.promise_reject_callback : PromiseRejectCallback; isolate->SetPromiseRejectCallback(promise_reject_cb); } |