Skip to content

Commit

Permalink
src: fix TryCatch deprecation warnings
Browse files Browse the repository at this point in the history
PR-URL: #4722
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
  • Loading branch information
targos authored and Ali Sheikh committed Mar 4, 2016
1 parent 81f1732 commit 79d7475
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ static Local<Value> ExecuteString(Environment* env,
Local<String> source,
Local<String> filename) {
EscapableHandleScope scope(env->isolate());
TryCatch try_catch;
TryCatch try_catch(env->isolate());

// try_catch must be nonverbose to disable FatalException() handler,
// we will handle exceptions ourself.
Expand Down Expand Up @@ -2327,7 +2327,7 @@ void FatalException(Isolate* isolate,
exit(6);
}

TryCatch fatal_try_catch;
TryCatch fatal_try_catch(isolate);

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

TryCatch try_catch;
TryCatch try_catch(env->isolate());

// Disable verbose mode to stop FatalException() handler from trying
// to handle the exception. Errors this early in the start-up phase
Expand Down
10 changes: 5 additions & 5 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ContextifyContext {
env->context(),
env->contextify_private_symbol()).FromJust());

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

if (try_catch.HasCaught()) {
Expand Down Expand Up @@ -493,7 +493,7 @@ class ContextifyScript : public BaseObject {
ContextifyScript* contextify_script =
new ContextifyScript(env, args.This());

TryCatch try_catch;
TryCatch try_catch(env->isolate());
Local<String> code = args[0]->ToString(env->isolate());
Local<String> filename = GetFilenameArg(args, 1);
Local<Integer> lineOffset = GetLineOffsetArg(args, 1);
Expand Down Expand Up @@ -569,7 +569,7 @@ class ContextifyScript : public BaseObject {
// args: [options]
static void RunInThisContext(const FunctionCallbackInfo<Value>& args) {
// Assemble arguments
TryCatch try_catch;
TryCatch try_catch(args.GetIsolate());
uint64_t timeout = GetTimeoutArg(args, 0);
bool display_errors = GetDisplayErrorsArg(args, 0);
if (try_catch.HasCaught()) {
Expand Down Expand Up @@ -597,7 +597,7 @@ class ContextifyScript : public BaseObject {

Local<Object> sandbox = args[0].As<Object>();
{
TryCatch try_catch;
TryCatch try_catch(env->isolate());
timeout = GetTimeoutArg(args, 1);
display_errors = GetDisplayErrorsArg(args, 1);
if (try_catch.HasCaught()) {
Expand All @@ -618,7 +618,7 @@ class ContextifyScript : public BaseObject {
return;

{
TryCatch try_catch;
TryCatch try_catch(env->isolate());
// Do the eval within the context
Context::Scope context_scope(contextify_context->context());
if (EvalMachine(contextify_context->env(),
Expand Down

0 comments on commit 79d7475

Please sign in to comment.