@@ -125,15 +125,13 @@ class ContextifyContext {
125
125
int length = names->Length ();
126
126
for (int i = 0 ; i < length; i++) {
127
127
Local<String> key = names->Get (i)->ToString (env ()->isolate ());
128
- auto maybe_has = sandbox_obj->HasOwnProperty (context, key);
128
+ Maybe< bool > has = sandbox_obj->HasOwnProperty (context, key);
129
129
130
130
// Check for pending exceptions
131
- if (!maybe_has.IsJust ())
132
- break ;
133
-
134
- bool has = maybe_has.FromJust ();
131
+ if (has.IsNothing ())
132
+ return ;
135
133
136
- if (!has) {
134
+ if (!has. FromJust () ) {
137
135
// Could also do this like so:
138
136
//
139
137
// PropertyAttribute att = global->GetPropertyAttributes(key_v);
@@ -316,7 +314,7 @@ class ContextifyContext {
316
314
}
317
315
Local<Object> sandbox = args[0 ].As <Object>();
318
316
319
- auto result =
317
+ Maybe< bool > result =
320
318
sandbox->HasPrivate (env->context (),
321
319
env->contextify_context_private_symbol ());
322
320
args.GetReturnValue ().Set (result.FromJust ());
@@ -332,7 +330,7 @@ class ContextifyContext {
332
330
static ContextifyContext* ContextFromContextifiedSandbox (
333
331
Environment* env,
334
332
const Local<Object>& sandbox) {
335
- auto maybe_value =
333
+ MaybeLocal<Value> maybe_value =
336
334
sandbox->GetPrivate (env->context (),
337
335
env->contextify_context_private_symbol ());
338
336
Local<Value> context_external_v;
@@ -506,8 +504,8 @@ class ContextifyScript : public BaseObject {
506
504
}
507
505
508
506
ScriptCompiler::CachedData* cached_data = nullptr ;
509
- if (!cached_data_buf. IsEmpty ()) {
510
- Local<Uint8Array> ui8 = cached_data_buf.ToLocalChecked ();
507
+ Local<Uint8Array> ui8;
508
+ if ( cached_data_buf.ToLocal (&ui8)) {
511
509
ArrayBuffer::Contents contents = ui8->Buffer ()->GetContents ();
512
510
cached_data = new ScriptCompiler::CachedData (
513
511
static_cast <uint8_t *>(contents.Data ()) + ui8->ByteOffset (),
@@ -655,7 +653,7 @@ class ContextifyScript : public BaseObject {
655
653
656
654
AppendExceptionLine (env, exception , try_catch.Message (), CONTEXTIFY_ERROR);
657
655
Local<Value> stack = err_obj->Get (env->stack_string ());
658
- auto maybe_value =
656
+ MaybeLocal<Value> maybe_value =
659
657
err_obj->GetPrivate (
660
658
env->context (),
661
659
env->arrow_message_private_symbol ());
0 commit comments