[Webkit-unassigned] [Bug 157872] Our parser doesn't properly parse default parameter expressions in a class method

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 31 12:17:31 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=157872

Saam Barati <sbarati at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #280110|review?                     |review+
              Flags|                            |

--- Comment #18 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 280110
  --> https://bugs.webkit.org/attachment.cgi?id=280110
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=280110&action=review

r=me wth comments

> Source/JavaScriptCore/parser/Parser.cpp:1929
> +    functionScope->setExpectedSuperBinding(expectedSuperBinding);

Can you remove the duplicate call below to setExpectedSuperKind(...)?

Also, I wonder if we should be calling setConstructKind up here too. I need to think about it more.

> Source/JavaScriptCore/tests/stress/arrow-functions-as-default-parameter-values.js:162
> +    class D extends C {
> +        x(y = (y = () => super.foo) => {return y()}) {
> +            return y();
> +        }
> +    }

Can you also add a test where we use super inside an arrow function inside a derived constructor's default parameter expression?

> LayoutTests/js/script-tests/parser-syntax-check.js:746
> +valid("class C { constructor() { this._x = 45; } get foo() { return this._x;} } class D extends C { x(y = (y = () => super.foo) => {return y()}) { return y(); } }")

Ditto for a constructor's syntax here

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160531/1319e4ea/attachment.html>


More information about the webkit-unassigned mailing list