cleaning up the grammar rule for Super
This commit is contained in:
parent
af3b356d70
commit
3881324007
|
@ -254,8 +254,8 @@
|
|||
})
|
||||
],
|
||||
Super: [
|
||||
o("SUPER CALL_START ArgList OptComma CALL_END", function() {
|
||||
return new CallNode('super', $3);
|
||||
o("SUPER Arguments", function() {
|
||||
return new CallNode('super', $2);
|
||||
})
|
||||
],
|
||||
This: [
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -308,7 +308,7 @@ grammar: {
|
|||
|
||||
# Calling super.
|
||||
Super: [
|
||||
o "SUPER CALL_START ArgList OptComma CALL_END", -> new CallNode 'super', $3
|
||||
o "SUPER Arguments", -> new CallNode 'super', $2
|
||||
]
|
||||
|
||||
# A reference to the *this* current object.
|
||||
|
|
|
@ -371,10 +371,10 @@ exports.CallNode: class CallNode extends BaseNode
|
|||
children: ['variable', 'args']
|
||||
|
||||
constructor: (variable, args) ->
|
||||
@isNew: false
|
||||
@isSuper: variable is 'super'
|
||||
@variable: if @isSuper then null else variable
|
||||
@args: (args or [])
|
||||
@isNew: false
|
||||
@isSuper: variable is 'super'
|
||||
@variable: if @isSuper then null else variable
|
||||
@args: (args or [])
|
||||
@compileSplatArguments: (o) ->
|
||||
SplatNode.compileMixedArray.call(this, @args, o)
|
||||
|
||||
|
|
Loading…
Reference in New Issue