[Webkit-unassigned] [Bug 194095] [JSC] Add support for static public class fields

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 12 02:46:55 PDT 2020


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

Xan Lopez <xan.lopez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #401133|0                           |1
        is obsolete|                            |
 Attachment #404092|                            |review?
              Flags|                            |

--- Comment #6 from Xan Lopez <xan.lopez at gmail.com> ---
Created attachment 404092

  --> https://bugs.webkit.org/attachment.cgi?id=404092&action=review

Add support for static public fields, v4

New version.

Fixed two of the failing V8 tests, a few other naming fixes, rebased against master.

There is one remaining V8 failure, but I think this is not a field bug per se, just the new code finding an old issue. Basically:

 let q = { ["z"]: class { static y = this.name } }
 assertEquals(q.z.y, 'z');

This will fail (the value of q.z.y is ''). The reason is that the existing code sets the function name for the class *after* the whole class is generated. The spec says it should happen within the class definition evaluation (see 14.6.14 Runtime Semantics: ClassDefinitionEvaluation). This was perhaps mostly harmless until now, but with static fields the initializer runs before the class evaluation is over, so it finds 'this.name' to be unitialized. This would work for a non-computed property name (z: class { ... }) because in that case the parser itself will already set the proper function name, but for computed property names that does not happen. I will open a follow-up for this issue if we agree it should be fixed in parallel.

-- 
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/20200712/827bbc85/attachment.htm>


More information about the webkit-unassigned mailing list