Index: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
index 1f7d79ad77138ed6a703d0afcebaaea6af7ebb0f..9da0f711e995627fb3472eb62a45ed2a77e69a57 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
@@ -305,6 +305,13 @@ void installMethodInternal(v8::Isolate* isolate, |
v8::Local<v8::Name> name = method.methodName(isolate); |
v8::FunctionCallback callback = method.callbackForWorld(world); |
+ // Promise-returning DOM operations need to return a reject promise when |
+ // an exception occurs. This includes a case that the receiver object is not |
+ // of the type. So, we disable the type check of the receiver object on V8 |
+ // side so that V8 won't throw. Instead, we do the check on Blink side and |
+ // convert an exception to a reject promise. |
+ if (method.holderCheckConfiguration == V8DOMConfiguration::DoNotCheckHolder) |
+ signature = v8::Local<v8::Signature>(); |
DCHECK(method.propertyLocationConfiguration); |
if (method.propertyLocationConfiguration & |
@@ -351,6 +358,13 @@ void installMethodInternal( |
v8::Local<v8::Name> name = method.methodName(isolate); |
v8::FunctionCallback callback = method.callbackForWorld(world); |
+ // Promise-returning DOM operations need to return a reject promise when |
+ // an exception occurs. This includes a case that the receiver object is not |
+ // of the type. So, we disable the type check of the receiver object on V8 |
+ // side so that V8 won't throw. Instead, we do the check on Blink side and |
+ // convert an exception to a reject promise. |
+ if (method.holderCheckConfiguration == V8DOMConfiguration::DoNotCheckHolder) |
+ signature = v8::Local<v8::Signature>(); |
DCHECK(method.propertyLocationConfiguration); |
if (method.propertyLocationConfiguration & |