Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 79d7475

Browse filesBrowse files
targosAli Sheikh
authored andcommitted
src: fix TryCatch deprecation warnings
PR-URL: #4722 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
1 parent 81f1732 commit 79d7475
Copy full SHA for 79d7475

File tree

Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ static Local<Value> ExecuteString(Environment* env,
16041604
Local<String> source,
16051605
Local<String> filename) {
16061606
EscapableHandleScope scope(env->isolate());
1607-
TryCatch try_catch;
1607+
TryCatch try_catch(env->isolate());
16081608

16091609
// try_catch must be nonverbose to disable FatalException() handler,
16101610
// we will handle exceptions ourself.
@@ -2327,7 +2327,7 @@ void FatalException(Isolate* isolate,
23272327
exit(6);
23282328
}
23292329

2330-
TryCatch fatal_try_catch;
2330+
TryCatch fatal_try_catch(isolate);
23312331

23322332
// Do not call FatalException when _fatalException handler throws
23332333
fatal_try_catch.SetVerbose(false);
@@ -3176,7 +3176,7 @@ void LoadEnvironment(Environment* env) {
31763176
// The node.js file returns a function 'f'
31773177
atexit(AtExit);
31783178

3179-
TryCatch try_catch;
3179+
TryCatch try_catch(env->isolate());
31803180

31813181
// Disable verbose mode to stop FatalException() handler from trying
31823182
// to handle the exception. Errors this early in the start-up phase
Collapse file

‎src/node_contextify.cc‎

Copy file name to clipboardExpand all lines: src/node_contextify.cc
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class ContextifyContext {
283283
env->context(),
284284
env->contextify_private_symbol()).FromJust());
285285

286-
TryCatch try_catch;
286+
TryCatch try_catch(env->isolate());
287287
ContextifyContext* context = new ContextifyContext(env, sandbox);
288288

289289
if (try_catch.HasCaught()) {
@@ -493,7 +493,7 @@ class ContextifyScript : public BaseObject {
493493
ContextifyScript* contextify_script =
494494
new ContextifyScript(env, args.This());
495495

496-
TryCatch try_catch;
496+
TryCatch try_catch(env->isolate());
497497
Local<String> code = args[0]->ToString(env->isolate());
498498
Local<String> filename = GetFilenameArg(args, 1);
499499
Local<Integer> lineOffset = GetLineOffsetArg(args, 1);
@@ -569,7 +569,7 @@ class ContextifyScript : public BaseObject {
569569
// args: [options]
570570
static void RunInThisContext(const FunctionCallbackInfo<Value>& args) {
571571
// Assemble arguments
572-
TryCatch try_catch;
572+
TryCatch try_catch(args.GetIsolate());
573573
uint64_t timeout = GetTimeoutArg(args, 0);
574574
bool display_errors = GetDisplayErrorsArg(args, 0);
575575
if (try_catch.HasCaught()) {
@@ -597,7 +597,7 @@ class ContextifyScript : public BaseObject {
597597

598598
Local<Object> sandbox = args[0].As<Object>();
599599
{
600-
TryCatch try_catch;
600+
TryCatch try_catch(env->isolate());
601601
timeout = GetTimeoutArg(args, 1);
602602
display_errors = GetDisplayErrorsArg(args, 1);
603603
if (try_catch.HasCaught()) {
@@ -618,7 +618,7 @@ class ContextifyScript : public BaseObject {
618618
return;
619619

620620
{
621-
TryCatch try_catch;
621+
TryCatch try_catch(env->isolate());
622622
// Do the eval within the context
623623
Context::Scope context_scope(contextify_context->context());
624624
if (EvalMachine(contextify_context->env(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.