File tree 4 files changed +29
-19
lines changed
4 files changed +29
-19
lines changed Original file line number Diff line number Diff line change @@ -487,24 +487,32 @@ inline uint32_t Environment::get_next_function_id() {
487
487
return function_id_counter_++;
488
488
}
489
489
490
- Environment:: ShouldNotAbortOnUncaughtScope::ShouldNotAbortOnUncaughtScope (
490
+ ShouldNotAbortOnUncaughtScope::ShouldNotAbortOnUncaughtScope (
491
491
Environment* env)
492
492
: env_(env) {
493
- env_->should_not_abort_scope_counter_ ++ ;
493
+ env_->PushShouldNotAbortOnUncaughtScope () ;
494
494
}
495
495
496
- Environment:: ShouldNotAbortOnUncaughtScope::~ShouldNotAbortOnUncaughtScope () {
496
+ ShouldNotAbortOnUncaughtScope::~ShouldNotAbortOnUncaughtScope () {
497
497
Close ();
498
498
}
499
499
500
- void Environment:: ShouldNotAbortOnUncaughtScope::Close () {
500
+ void ShouldNotAbortOnUncaughtScope::Close () {
501
501
if (env_ != nullptr ) {
502
- env_->should_not_abort_scope_counter_ -- ;
502
+ env_->PopShouldNotAbortOnUncaughtScope () ;
503
503
env_ = nullptr ;
504
504
}
505
505
}
506
506
507
- bool Environment::inside_should_not_abort_on_uncaught_scope () const {
507
+ inline void Environment::PushShouldNotAbortOnUncaughtScope () {
508
+ should_not_abort_scope_counter_++;
509
+ }
510
+
511
+ inline void Environment::PopShouldNotAbortOnUncaughtScope () {
512
+ should_not_abort_scope_counter_--;
513
+ }
514
+
515
+ inline bool Environment::inside_should_not_abort_on_uncaught_scope () const {
508
516
return should_not_abort_scope_counter_ > 0 ;
509
517
}
510
518
Original file line number Diff line number Diff line change @@ -679,6 +679,16 @@ class TrackingTraceStateObserver :
679
679
Environment* env_;
680
680
};
681
681
682
+ class ShouldNotAbortOnUncaughtScope {
683
+ public:
684
+ explicit inline ShouldNotAbortOnUncaughtScope (Environment* env);
685
+ inline void Close ();
686
+ inline ~ShouldNotAbortOnUncaughtScope ();
687
+
688
+ private:
689
+ Environment* env_;
690
+ };
691
+
682
692
class Environment {
683
693
public:
684
694
Environment (const Environment&) = delete ;
@@ -998,16 +1008,8 @@ class Environment {
998
1008
// This needs to be available for the JS-land setImmediate().
999
1009
void ToggleImmediateRef (bool ref);
1000
1010
1001
- class ShouldNotAbortOnUncaughtScope {
1002
- public:
1003
- explicit inline ShouldNotAbortOnUncaughtScope (Environment* env);
1004
- inline void Close ();
1005
- inline ~ShouldNotAbortOnUncaughtScope ();
1006
-
1007
- private:
1008
- Environment* env_;
1009
- };
1010
-
1011
+ inline void PushShouldNotAbortOnUncaughtScope ();
1012
+ inline void PopShouldNotAbortOnUncaughtScope ();
1011
1013
inline bool inside_should_not_abort_on_uncaught_scope () const ;
1012
1014
1013
1015
static inline Environment* ForAsyncHooks (AsyncHooks* hooks);
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
136
136
column_offset = Integer::New (isolate, 0 );
137
137
}
138
138
139
- Environment:: ShouldNotAbortOnUncaughtScope no_abort_scope (env);
139
+ ShouldNotAbortOnUncaughtScope no_abort_scope (env);
140
140
TryCatchScope try_catch (env);
141
141
Local<Module> module;
142
142
@@ -280,7 +280,7 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
280
280
CHECK (args[1 ]->IsBoolean ());
281
281
bool break_on_sigint = args[1 ]->IsTrue ();
282
282
283
- Environment:: ShouldNotAbortOnUncaughtScope no_abort_scope (env);
283
+ ShouldNotAbortOnUncaughtScope no_abort_scope (env);
284
284
TryCatchScope try_catch (env);
285
285
286
286
bool timed_out = false ;
Original file line number Diff line number Diff line change @@ -719,7 +719,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
719
719
compile_options = ScriptCompiler::kConsumeCodeCache ;
720
720
721
721
TryCatchScope try_catch (env);
722
- Environment:: ShouldNotAbortOnUncaughtScope no_abort_scope (env);
722
+ ShouldNotAbortOnUncaughtScope no_abort_scope (env);
723
723
Context::Scope scope (parsing_context);
724
724
725
725
MaybeLocal<UnboundScript> v8_script = ScriptCompiler::CompileUnboundScript (
You can’t perform that action at this time.
0 commit comments