Stop representing quoted member functions as computed properties in the AST #3071
Labels
internal cleanup
internal-issue-created
An internal Google issue has been created to track this GitHub issue
P3
triage-done
Has been reviewed by someone on triage rotation.
Filing this after internal discussion with @concavelenz
Right now the compiler represents quoted member functions, e.g.
class C { 'f'() {} }
, the same way it represents computed property member functions:class C { ['f']() {} }
.This means that the compiler prints
class C { ['f']() {} }
if givenclass C { 'f'() {} }
: example.This does not align with how we treat quoted regular object literal properties, getters, and setters. Those have a special 'quoted_prop' attribute to store whether they were originally quoted or not.
closure-compiler/src/com/google/javascript/rhino/Node.java
Line 385 in 6f01d69
Computed properties/getter/setters are stored differently in the AST.
We probably want to revisit this decision at some point:
The text was updated successfully, but these errors were encountered: