src: move ShouldNotAbortOnUncaughtScope out of Environment · nodejs/node@f50c9c6 · GitHub
Skip to content

Commit f50c9c6

Browse files
joyeecheungtargos
authored andcommitted
src: move ShouldNotAbortOnUncaughtScope out of Environment
PR-URL: #26824 Refs: #26776 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7e7f077 commit f50c9c6

4 files changed

Lines changed: 29 additions & 19 deletions

File tree

src/env-inl.h

Lines changed: 14 additions & 6 deletions

src/env.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,16 @@ class TrackingTraceStateObserver :
679679
Environment* env_;
680680
};
681681

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+
682692
class Environment {
683693
public:
684694
Environment(const Environment&) = delete;
@@ -998,16 +1008,8 @@ class Environment {
9981008
// This needs to be available for the JS-land setImmediate().
9991009
void ToggleImmediateRef(bool ref);
10001010

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();
10111013
inline bool inside_should_not_abort_on_uncaught_scope() const;
10121014

10131015
static inline Environment* ForAsyncHooks(AsyncHooks* hooks);

src/module_wrap.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
136136
column_offset = Integer::New(isolate, 0);
137137
}
138138

139-
Environment::ShouldNotAbortOnUncaughtScope no_abort_scope(env);
139+
ShouldNotAbortOnUncaughtScope no_abort_scope(env);
140140
TryCatchScope try_catch(env);
141141
Local<Module> module;
142142

@@ -280,7 +280,7 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
280280
CHECK(args[1]->IsBoolean());
281281
bool break_on_sigint = args[1]->IsTrue();
282282

283-
Environment::ShouldNotAbortOnUncaughtScope no_abort_scope(env);
283+
ShouldNotAbortOnUncaughtScope no_abort_scope(env);
284284
TryCatchScope try_catch(env);
285285

286286
bool timed_out = false;

src/node_contextify.cc

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)