Commit 085c9ffe authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

IDL parser: Make AsyncIterable independent from Iterable

"async iterable" and "iterable" are literally similar, but
have different definitions in spec.
And it provides us following benefit to separate "async iterable"
and "iterable";
- It makes easy to dispatch different functions in the code generator.
  https://cs.chromium.org/chromium/src/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py?q=ir_builder&dr&l=104&rcl=489221aa216913b574354b09ff94469151b682b4
  is a bad example that comes from setting "callback" property on "interface" node.
- Current code generators do not support "async iterable", but they accidentally accept
  it as "(synchronous) iterable" without throwing errors.  This CL makes it an error.


Bug: 839389
Change-Id: Ie48829802ac2a73916ba081459208c0d11f13740
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1855540
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705022}
parent d7213e95
...@@ -670,8 +670,7 @@ class IDLParser(object): ...@@ -670,8 +670,7 @@ class IDLParser(object):
def p_AsyncIterable(self, p): def p_AsyncIterable(self, p):
"""AsyncIterable : ASYNC ITERABLE '<' TypeWithExtendedAttributes ',' TypeWithExtendedAttributes '>' ';'""" """AsyncIterable : ASYNC ITERABLE '<' TypeWithExtendedAttributes ',' TypeWithExtendedAttributes '>' ';'"""
childlist = ListFromConcat(p[4], p[6]) childlist = ListFromConcat(p[4], p[6])
p[0] = self.BuildProduction('Iterable', p, 2, childlist) p[0] = self.BuildProduction('AsyncIterable', p, 2, childlist)
p[0].AddChildren(self.BuildTrue('ASYNC'))
def p_ReadWriteMaplike(self, p): def p_ReadWriteMaplike(self, p):
"""ReadWriteMaplike : MaplikeRest""" """ReadWriteMaplike : MaplikeRest"""
......
...@@ -436,8 +436,7 @@ interface MyIfacePromise { ...@@ -436,8 +436,7 @@ interface MyIfacePromise {
* PrimitiveType(long long) * PrimitiveType(long long)
* ExtAttributes() * ExtAttributes()
* ExtAttribute(EnforceRange) * ExtAttribute(EnforceRange)
* Iterable() * AsyncIterable()
* ASYNC: True
* Type() * Type()
* PrimitiveType(double) * PrimitiveType(double)
* Type() * Type()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment