Allow applying 'get'/'set' property to a bracketless object (#4730)

This commit is contained in:
Matthew Ryan
2017-10-02 19:10:43 +01:00
committed by Geoffrey Booth
parent 08e00331dd
commit bb2871fdde
3 changed files with 13 additions and 2 deletions

View File

@@ -806,6 +806,12 @@ test "functions named get or set can be used without parentheses when attached t
a = new A()
class B
get: (x) -> x.value + 6
set: (x) -> x.value + 7
b = new B()
eq 12, obj.get 10
eq 13, obj.set 10
@@ -825,3 +831,8 @@ test "functions named get or set can be used without parentheses when attached t
eq 12, obj.obj.get @ten
eq 13, obj.obj.set @ten
eq 16, b.get value: 10
eq 17, b.set value: 10
eq 16, b.get value: @ten
eq 17, b.set value: @ten