Skip to content

Commit 852c578

Browse files
Julian RosseGeoffreyBooth
authored andcommitted
[CS2]: Fix #4591: multiple accesses after super (#4592)
* support multiple accesses after super [Fixes #4591] * addtl tests from code review
1 parent 50674cb commit 852c578

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/classes.coffee

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,3 +1808,28 @@ test 'Bound method of immediately instantiated class with expression base class
18081808

18091809
{derivedBound} = a
18101810
eq derivedBound(), 3
1811+
1812+
test "#4591: super.x.y, super['x'].y", ->
1813+
class A
1814+
x:
1815+
y: 1
1816+
z: -> 2
1817+
1818+
class B extends A
1819+
constructor: ->
1820+
super()
1821+
1822+
@w = super.x.y
1823+
@v = super['x'].y
1824+
@u = super.x['y']
1825+
@t = super.x.z()
1826+
@s = super['x'].z()
1827+
@r = super.x['z']()
1828+
1829+
b = new B
1830+
eq 1, b.w
1831+
eq 1, b.v
1832+
eq 1, b.u
1833+
eq 2, b.t
1834+
eq 2, b.s
1835+
eq 2, b.r

0 commit comments

Comments
 (0)