diff options
author | Shelley Vohr <shelley.vohr@gmail.com> | 2019-10-25 21:14:36 -0700 |
---|---|---|
committer | Shelley Vohr <shelley.vohr@gmail.com> | 2019-11-01 10:22:37 -0700 |
commit | fc02cf586a4b146195a5f09a21fb34269657c484 (patch) | |
tree | ae6c1bc391aa720b4ad7bb765dc219d6ecfcc15f /src/node_main_instance.cc | |
parent | 75dc8938a40100a53323ed87159a1ab2f149ceca (diff) | |
download | node-new-fc02cf586a4b146195a5f09a21fb34269657c484.tar.gz |
src: expose granular SetIsolateUpForNode
This PR exposes a new embedder-focused API: SetIsolateUpForNode.
It maintains previous behavior for the single-param version of
SetIsolateUpForNode and changes no defaults, but was designed to be
flexible by allowing for embedders to conditionally override all
callbacks and flags set by the previous two-param version of
SetIsolateUpForNode.
PR-URL: https://github.com/nodejs/node/pull/30150
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/node_main_instance.cc')
-rw-r--r-- | src/node_main_instance.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index 0744063e0d..1c1a09280b 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -30,7 +30,9 @@ NodeMainInstance::NodeMainInstance(Isolate* isolate, owns_isolate_(false), deserialize_mode_(false) { isolate_data_.reset(new IsolateData(isolate_, event_loop, platform, nullptr)); - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kMisc); + + IsolateSettings misc; + SetIsolateMiscHandlers(isolate_, misc); } std::unique_ptr<NodeMainInstance> NodeMainInstance::Create( @@ -74,11 +76,12 @@ NodeMainInstance::NodeMainInstance( platform, array_buffer_allocator_.get(), per_isolate_data_indexes)); - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kMisc); + IsolateSettings s; + SetIsolateMiscHandlers(isolate_, s); if (!deserialize_mode_) { // If in deserialize mode, delay until after the deserialization is // complete. - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kErrorHandlers); + SetIsolateErrorHandlers(isolate_, s); } } @@ -182,7 +185,8 @@ std::unique_ptr<Environment> NodeMainInstance::CreateMainEnvironment( context = Context::FromSnapshot(isolate_, kNodeContextIndex).ToLocalChecked(); InitializeContextRuntime(context); - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kErrorHandlers); + IsolateSettings s; + SetIsolateErrorHandlers(isolate_, s); } else { context = NewContext(isolate_); } |