@@ -139,13 +139,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
139
139
if (!deserializer->ReadUint32 (&id))
140
140
return MaybeLocal<Object>();
141
141
142
- EscapableHandleScope scope (isolate);
143
- Local<Context> context = isolate->GetCurrentContext ();
144
- if (id == kDOMExceptionTag ) {
145
- return ReadDOMException (isolate, context, deserializer);
146
- }
147
-
148
- if (id != kNormalObject ) {
142
+ if (id != kNormalObject && id != kDOMExceptionTag ) {
149
143
CHECK_LT (id, host_objects_.size ());
150
144
Local<Object> object = host_objects_[id]->object (isolate);
151
145
if (env_->js_transferable_constructor_template ()->HasInstance (object)) {
@@ -154,6 +148,12 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
154
148
return object;
155
149
}
156
150
}
151
+
152
+ EscapableHandleScope scope (isolate);
153
+ Local<Context> context = isolate->GetCurrentContext ();
154
+ if (id == kDOMExceptionTag ) {
155
+ return ReadDOMException (isolate, context, deserializer);
156
+ }
157
157
Local<Value> object;
158
158
if (!deserializer->ReadValue (context).ToLocal (&object))
159
159
return MaybeLocal<Object>();
@@ -424,21 +424,11 @@ Maybe<bool> IsDOMException(Isolate* isolate,
424
424
Local<Object> obj) {
425
425
HandleScope handle_scope (isolate);
426
426
427
- Local<Object> per_context_bindings;
428
427
Local<Value> dom_exception_ctor_val;
429
-
430
- if (!GetPerContextExports (context).ToLocal (&per_context_bindings)) {
428
+ if (!GetDOMException (context).ToLocal (&dom_exception_ctor_val)) {
431
429
return Just (false );
432
430
}
433
431
434
- if (!per_context_bindings
435
- ->Get (context,
436
- FIXED_ONE_BYTE_STRING (isolate, " DOMException" ))
437
- .ToLocal (&dom_exception_ctor_val) ||
438
- !dom_exception_ctor_val->IsFunction ()) {
439
- return Nothing<bool >();
440
- }
441
-
442
432
Local<Function> dom_exception_ctor = dom_exception_ctor_val.As <Function>();
443
433
Local<Value> obj_constructor;
444
434
if (!obj->Get (context, FIXED_ONE_BYTE_STRING (isolate, " constructor" ))
0 commit comments