Fix exception scope verification failures in runtime/Intl* files.
[WebKit-https.git] / Source / JavaScriptCore / runtime / IntlObjectInlines.h
index 72be09b4d894a706e47a56f07143a28eb0ead244..eb0e859764d182863f0fc0ab53e953c444bcfd60 100644 (file)
@@ -44,7 +44,9 @@ JSValue constructIntlInstanceWithWorkaroundForLegacyIntlConstructor(ExecState& s
 
     if (!jsDynamicCast<IntlInstance*>(thisValue)) {
         JSValue prototype = callee->getDirect(vm, vm.propertyNames->prototype);
-        if (JSObject::defaultHasInstance(&state, thisValue, prototype)) {
+        bool hasInstance = JSObject::defaultHasInstance(&state, thisValue, prototype);
+        RETURN_IF_EXCEPTION(scope, JSValue());
+        if (hasInstance) {
             JSObject* thisObject = thisValue.toObject(&state);
             RETURN_IF_EXCEPTION(scope, JSValue());
 
@@ -55,7 +57,7 @@ JSValue constructIntlInstanceWithWorkaroundForLegacyIntlConstructor(ExecState& s
             return thisObject;
         }
     }
-
+    scope.release();
     return factory(vm);
 }