cleaning up the grammar rule for Super

This commit is contained in:
Jeremy Ashkenas 2010-06-27 16:50:31 -04:00
parent af3b356d70
commit 3881324007
4 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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.

View File

@ -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)