Unexpected ExceptionState& parameter in `toStringMethod` disagrees with *.idl definition |
||||
Issue descriptionAs part of my work I modified the definition of href attribute in third_party/blink/renderer/core/html/html_hyperlink_element_utils.idl. Old version: [CEReactions] stringifier attribute USVString href; New version: [CEReactions, RaisesException=Setter, CallWith=ScriptState] stringifier attribute URLString href; I also modified appropriate href() and setHref() functions. After the change, during the build, files: v8_html_anchor_element.cc and v8_html_area_element.cc need a href() version with signature: href(ScriptState*, ExceptionState&). Nevertheless, in the *.idl file I explicitly stated that only the setter (i.e. setHref()) should raise exceptions.
,
Jul 20
The attribute getter has the right signature, it's the toString() code that's buggy:
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "HTMLAnchorElement", "toString");
CEReactionsScope ce_reactions_scope;
HTMLAnchorElement* impl = V8HTMLAnchorElement::ToImpl(info.Holder());
- V8SetReturnValueString(info, impl->href(), info.GetIsolate());
+ ScriptState* scriptState = ScriptState::ForRelevantRealm(info);
+
+ String result = impl->href(scriptState, exceptionState);
+ if (exceptionState.HadException()) {
+ return;
+ }
+ V8SetReturnValueString(info, result, info.GetIsolate());
}
,
Jul 20
,
Jul 20
To anyone willing to work on this: toString() is created via v8_interface.py and v8_methods.py, which don't have the logic for determining if RaisesException was passed a value like "Setter" in the IDL. That's done in v8_attributes.py.
,
Nov 30
|
||||
►
Sign in to add a comment |
||||
Comment 1 by mkwst@chromium.org
, Jul 19Components: -Blink>DOM Blink>Bindings
Owner: ----