src: replace FromJust() with Check() when possible · nodejs/node@060d901 (original) (raw)
`@@ -58,17 +58,17 @@ Local ErrnoException(Isolate* isolate,
`
58
58
` Local obj = e.As();
`
59
59
` obj->Set(env->context(),
`
60
60
` env->errno_string(),
`
61
``
`-
Integer::New(isolate, errorno)).FromJust();
`
62
``
`-
obj->Set(env->context(), env->code_string(), estring).FromJust();
`
``
61
`+
Integer::New(isolate, errorno)).Check();
`
``
62
`+
obj->Set(env->context(), env->code_string(), estring).Check();
`
63
63
``
64
64
`if (path_string.IsEmpty() == false) {
`
65
``
`-
obj->Set(env->context(), env->path_string(), path_string).FromJust();
`
``
65
`+
obj->Set(env->context(), env->path_string(), path_string).Check();
`
66
66
` }
`
67
67
``
68
68
`if (syscall != nullptr) {
`
69
69
` obj->Set(env->context(),
`
70
70
` env->syscall_string(),
`
71
``
`-
OneByteString(isolate, syscall)).FromJust();
`
``
71
`+
OneByteString(isolate, syscall)).Check();
`
72
72
` }
`
73
73
``
74
74
`return e;
`
`@@ -144,13 +144,13 @@ Local UVException(Isolate* isolate,
`
144
144
``
145
145
` e->Set(env->context(),
`
146
146
` env->errno_string(),
`
147
``
`-
Integer::New(isolate, errorno)).FromJust();
`
148
``
`-
e->Set(env->context(), env->code_string(), js_code).FromJust();
`
149
``
`-
e->Set(env->context(), env->syscall_string(), js_syscall).FromJust();
`
``
147
`+
Integer::New(isolate, errorno)).Check();
`
``
148
`+
e->Set(env->context(), env->code_string(), js_code).Check();
`
``
149
`+
e->Set(env->context(), env->syscall_string(), js_syscall).Check();
`
150
150
`if (!js_path.IsEmpty())
`
151
``
`-
e->Set(env->context(), env->path_string(), js_path).FromJust();
`
``
151
`+
e->Set(env->context(), env->path_string(), js_path).Check();
`
152
152
`if (!js_dest.IsEmpty())
`
153
``
`-
e->Set(env->context(), env->dest_string(), js_dest).FromJust();
`
``
153
`+
e->Set(env->context(), env->dest_string(), js_dest).Check();
`
154
154
``
155
155
`return e;
`
156
156
`}
`
`@@ -219,21 +219,21 @@ Local WinapiErrnoException(Isolate* isolate,
`
219
219
``
220
220
` Local obj = e.As();
`
221
221
` obj->Set(env->context(), env->errno_string(), Integer::New(isolate, errorno))
`
222
``
`-
.FromJust();
`
``
222
`+
.Check();
`
223
223
``
224
224
`if (path != nullptr) {
`
225
225
` obj->Set(env->context(),
`
226
226
` env->path_string(),
`
227
227
`String::NewFromUtf8(isolate, path, NewStringType::kNormal)
`
228
228
` .ToLocalChecked())
`
229
``
`-
.FromJust();
`
``
229
`+
.Check();
`
230
230
` }
`
231
231
``
232
232
`if (syscall != nullptr) {
`
233
233
` obj->Set(env->context(),
`
234
234
` env->syscall_string(),
`
235
235
`OneByteString(isolate, syscall))
`
236
``
`-
.FromJust();
`
``
236
`+
.Check();
`
237
237
` }
`
238
238
``
239
239
`if (must_free) {
`