@@ -139,13 +139,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
139139 if (!deserializer->ReadUint32 (&id))
140140 return MaybeLocal<Object>();
141141
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 ) {
149143 CHECK_LT (id, host_objects_.size ());
150144 Local<Object> object = host_objects_[id]->object (isolate);
151145 if (env_->js_transferable_constructor_template ()->HasInstance (object)) {
@@ -154,6 +148,12 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
154148 return object;
155149 }
156150 }
151+
152+ EscapableHandleScope scope (isolate);
153+ Local<Context> context = isolate->GetCurrentContext ();
154+ if (id == kDOMExceptionTag ) {
155+ return ReadDOMException (isolate, context, deserializer);
156+ }
157157 Local<Value> object;
158158 if (!deserializer->ReadValue (context).ToLocal (&object))
159159 return MaybeLocal<Object>();
@@ -424,21 +424,11 @@ Maybe<bool> IsDOMException(Isolate* isolate,
424424 Local<Object> obj) {
425425 HandleScope handle_scope (isolate);
426426
427- Local<Object> per_context_bindings;
428427 Local<Value> dom_exception_ctor_val;
429-
430- if (!GetPerContextExports (context).ToLocal (&per_context_bindings)) {
428+ if (!GetDOMException (context).ToLocal (&dom_exception_ctor_val)) {
431429 return Just (false );
432430 }
433431
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-
442432 Local<Function> dom_exception_ctor = dom_exception_ctor_val.As <Function>();
443433 Local<Value> obj_constructor;
444434 if (!obj->Get (context, FIXED_ONE_BYTE_STRING (isolate, " constructor" ))
0 commit comments