mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
* Fix #4464: backticked expressions in class body should be left in the body, not hoisted
* Fix #4464: backticked expressions in class body should be left in the body, not hoisted
* Simplify fix for #4464
This uses more of the existing machinery for moving class body
expressions into the initializer.
* Clarify the purpose of Class::addInitializerExpression
* Further clarify the purpose of Class::addInitializerExpression
* Add reference to class fields; format
comment wrapping
* Reapply 1d3af8c432, that got lost because of rebase/force-push shenanigans
* Updated output
This commit is contained in:
committed by
Geoffrey Booth
parent
5cbd25f5d4
commit
27eff5ca77
@@ -1833,3 +1833,18 @@ test "#4591: super.x.y, super['x'].y", ->
|
||||
eq 2, b.t
|
||||
eq 2, b.s
|
||||
eq 2, b.r
|
||||
|
||||
test "#4464: backticked expressions in class body", ->
|
||||
class A
|
||||
`get x() { return 42; }`
|
||||
|
||||
class B
|
||||
`get x() { return 42; }`
|
||||
constructor: ->
|
||||
@y = 84
|
||||
|
||||
a = new A
|
||||
eq 42, a.x
|
||||
b = new B
|
||||
eq 42, b.x
|
||||
eq 84, b.y
|
||||
|
||||
Reference in New Issue
Block a user