diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chromium/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc b/chromium/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc index 2394eec2ba1..ba8e013d0c7 100644 --- a/chromium/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc +++ b/chromium/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc @@ -18,8 +18,9 @@ CallbackMethodRetriever::CallbackMethodRetriever( DCHECK(constructor_->IsConstructor()); } -void CallbackMethodRetriever::GetPrototypeObject( +v8::Local<v8::Object> CallbackMethodRetriever::GetPrototypeObject( ExceptionState& exception_state) { + DCHECK(prototype_object_.IsEmpty()) << "Do not call GetPrototypeObject twice"; // https://html.spec.whatwg.org/C/custom-elements.html#element-definition // step 10.1. Let prototype be Get(constructor, "prototype"). Rethrow any // exceptions. @@ -29,15 +30,16 @@ void CallbackMethodRetriever::GetPrototypeObject( ->Get(current_context_, V8AtomicString(isolate_, "prototype")) .ToLocal(&prototype)) { exception_state.RethrowV8Exception(try_catch.Exception()); - return; + return v8::Local<v8::Object>(); } // step 10.2. If Type(prototype) is not Object, then throw a TypeError // exception. if (!prototype->IsObject()) { exception_state.ThrowTypeError("constructor prototype is not an object"); - return; + return v8::Local<v8::Object>(); } prototype_object_ = prototype.As<v8::Object>(); + return prototype_object_; } v8::Local<v8::Value> CallbackMethodRetriever::GetFunctionOrUndefined( |