Skip to content

Commit

Permalink
WebIDL parser replacing void with undefined
Browse files Browse the repository at this point in the history
This change to the parser at the moment is only internal, and in this
commit an affected override is corrected accordingly. IDL files still
cal use `void` at the moment.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/5e8a1af4b7b9bb9a7d2948758b41ef3bf9abc36f

commit 5e8a1af4b7b9bb9a7d2948758b41ef3bf9abc36f
Author: Yuki Shiino <[email protected]>
Date:   Wed Nov 1 15:08:24 2023 +0000

    bindings: Rename 'void' to 'undefined' in bindings/scripts/

    This patch renames only the internal implementation code in
    web_idl/ and bind_gen/, and doesn't rename any IDL code in
    *.idl files.

    Web IDL 2.13.2. undefined
    https://webidl.spec.whatwg.org/#idl-undefined
    See also whatwg/webidl#906

    Bug: 1116522
  • Loading branch information
cdesouza-chromium authored and mkarolin committed Jan 12, 2024
1 parent 3039ea0 commit 6f9bbf5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@ def _append_report_page_graph_api_call_event(cg_context, expr):
exception_state = "nullptr"

# Extract return value. See `bind_return_value` in upstream interface.py.
is_return_type_void = ((not cg_context.return_type
or cg_context.return_type.unwrap().is_void)
and not cg_context.does_override_idl_return_type)
if is_return_type_void or hasattr(cg_context, _IS_OBSERVABLE_ARRAY_SETTER):
is_return_type_undefined = (
(not cg_context.return_type
or cg_context.return_type.unwrap().is_undefined)
and not cg_context.does_override_idl_return_type)
if is_return_type_undefined or hasattr(cg_context,
_IS_OBSERVABLE_ARRAY_SETTER):
return_value = "std::nullopt"
else:
return_value = _to_page_graph_blink_arg("return_value")
Expand Down

0 comments on commit 6f9bbf5

Please sign in to comment.