Using extends apart from class declaration
I wonder if extends can be used apart from declaring class. The following code worked, through I doubt if extends should be used apart from class declaration.
A =
name: "John"
B =
age: 12
C =
description: "I love CoffeeScript"
D = A extends B extends C
for prop, value of D
console.log "#{prop} = #{value}"
I'm interested to know if this is an official feature too.
https://github.com/jashkenas/coffee-script/blob/1.0.1/src/grammar.coffee#L535
Yes, as @satyr pointed out, this is already a part of the language. Closing.
This doesn't appear to be documented anywhere but the grammar—might be a good move to add a line somewhere clarifying it. :)
@erisdiscord: Yeah, good idea. Re-opening.
It was only mentioned in a few words in the docs -- I've expanded the mention. Thanks for opening the issue.