[Webkit-unassigned] [Bug 140491] Implement ES6 class syntax

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 17 21:28:28 PST 2015


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

--- Comment #6 from Ryosuke Niwa <rniwa at webkit.org> ---
The new WIP is still missing two major pieces:

1. Throw ReferneceError when "this" is still in "uninitialized" state (i.e. before "super()" is called) in a derived class' constructor.
2. Auto generate the constructor when it's not supplied.

I think I'll do 2 in a separate follow-up patch since JSC doesn't have a facility to generate a Miranda function.

I've talked about 1 with Oliver and Gavin, and the approach we came up so far (if I remember correctly) is to allocate a local variable/register that stores "uninitialized-ness" of the "this" variable. Inside ThisNode or wherever else "this" is accessed, we'll generate a code to check this state and throw ReferenceError when it's not initialized.

Once that's implemented, we can optimize this in the parser as well as in the bytecode generator for common cases.  e.g. in cases where we can guarantee that super() is definitively called before "this" is used, we can omit this check.  Even if we didn't implement such an optimization, DFG might be able to optimize them away.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150118/fd3e950d/attachment-0002.html>


More information about the webkit-unassigned mailing list