| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 392c881 commit 3f62f99
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -104,9 +104,9 @@ static MaybeLocal<Value> WASIException(Local<Context> context, | |||
| 104 | 104 | js_msg = | |
| 105 | 105 | String::Concat(isolate, js_msg, FIXED_ONE_BYTE_STRING(isolate, ", ")); | |
| 106 | 106 | js_msg = String::Concat(isolate, js_msg, js_syscall); | |
| 107 | - Local<Object> e = | ||
| 108 | - Exception::Error(js_msg)->ToObject(context) | ||
| 109 | - .ToLocalChecked(); | ||
| 107 | + Local<Object> e; | ||
| 108 | + if (!Exception::Error(js_msg)->ToObject(context).ToLocal(&e)) | ||
| 109 | + return MaybeLocal<Value>(); | ||
| 110 | 110 | ||
| 111 | 111 | if (e->Set(context, | |
| 112 | 112 | env->errno_string(), | |
@@ -128,13 +128,11 @@ WASI::WASI(Environment* env, | |||
| 128 | 128 | options->allocator = &alloc_info_; | |
| 129 | 129 | int err = uvwasi_init(&uvw_, options); | |
| 130 | 130 | if (err != UVWASI_ESUCCESS) { | |
| 131 | - Local<Context> context = env->context(); | ||
| 132 | - MaybeLocal<Value> exception = WASIException(context, err, "uvwasi_init"); | ||
| 133 | - | ||
| 134 | - if (exception.IsEmpty()) | ||
| 131 | + Local<Value> exception; | ||
| 132 | + if (!WASIException(env->context(), err, "uvwasi_init").ToLocal(&exception)) | ||
| 135 | 133 | return; | |
| 136 | 134 | ||
| 137 | - context->GetIsolate()->ThrowException(exception.ToLocalChecked()); | ||
| 135 | + env->isolate()->ThrowException(exception); | ||
| 138 | 136 | } | |
| 139 | 137 | } | |
| 140 | 138 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments