jashkenas/coffeescript
Ver no GitHubProposal: allow super in object literals
Open
#5.075 aberto em 23 de mai. de 2018
enhancementhelp wanted
Métricas do repositório
- Stars
- (16.577 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
obj1 = ->
method1: ->
console.log 'method1'
obj2 =
method2: ->
super.method1()
Object.setPrototypeOf obj2, obj1
obj2.method2() # logs "method1"
The obj2 variable would transpile to:
obj2 = {
method2() {
super.method1();
}
};