mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
commit
b7b92eddbd
2 changed files with 7 additions and 7 deletions
|
@ -347,8 +347,8 @@ exports.Lexer = class Lexer
|
||||||
prev[1] += '='
|
prev[1] += '='
|
||||||
return value.length
|
return value.length
|
||||||
if value is ';'
|
if value is ';'
|
||||||
@seenFor = no
|
@seenFor = no
|
||||||
tag = 'TERMINATOR'
|
tag = 'TERMINATOR'
|
||||||
else if value in MATH then tag = 'MATH'
|
else if value in MATH then tag = 'MATH'
|
||||||
else if value in COMPARE then tag = 'COMPARE'
|
else if value in COMPARE then tag = 'COMPARE'
|
||||||
else if value in COMPOUND_ASSIGN then tag = 'COMPOUND_ASSIGN'
|
else if value in COMPOUND_ASSIGN then tag = 'COMPOUND_ASSIGN'
|
||||||
|
|
|
@ -1256,9 +1256,9 @@ exports.Param = class Param extends Base
|
||||||
|
|
||||||
# Finds the name or names of a `Param`; useful for detecting duplicates.
|
# Finds the name or names of a `Param`; useful for detecting duplicates.
|
||||||
# In a sense, a destructured parameter represents multiple JS parameters,
|
# In a sense, a destructured parameter represents multiple JS parameters,
|
||||||
# thus this method returns an `Array` of names.
|
# thus this method returns an `Array` of names.
|
||||||
# Reserved words used as param names, as well as the Object and Array
|
# Reserved words used as param names, as well as the Object and Array
|
||||||
# literals used for destructured params, get a compiler generated name
|
# literals used for destructured params, get a compiler generated name
|
||||||
# during the `Code` compilation step, so this is necessarily an incomplete
|
# during the `Code` compilation step, so this is necessarily an incomplete
|
||||||
# list of a parameter's names.
|
# list of a parameter's names.
|
||||||
names: (name = @name)->
|
names: (name = @name)->
|
||||||
|
@ -1281,7 +1281,7 @@ exports.Param = class Param extends Base
|
||||||
else if obj.this
|
else if obj.this
|
||||||
names.push atParam(obj)...
|
names.push atParam(obj)...
|
||||||
# * simple destructured parameters {foo}
|
# * simple destructured parameters {foo}
|
||||||
else names.push obj.base.value
|
else names.push obj.base.value
|
||||||
names
|
names
|
||||||
|
|
||||||
#### Splat
|
#### Splat
|
||||||
|
@ -1478,7 +1478,7 @@ exports.Op = class Op extends Base
|
||||||
if @operator is 'delete' and o.scope.check(@first.unwrapAll().value)
|
if @operator is 'delete' and o.scope.check(@first.unwrapAll().value)
|
||||||
throw SyntaxError 'delete operand may not be argument or var'
|
throw SyntaxError 'delete operand may not be argument or var'
|
||||||
if @operator in ['--', '++'] and @first.unwrapAll().value in STRICT_PROSCRIBED
|
if @operator in ['--', '++'] and @first.unwrapAll().value in STRICT_PROSCRIBED
|
||||||
throw SyntaxError 'prefix increment/decrement may not have eval or arguments operand'
|
throw SyntaxError 'prefix increment/decrement may not have eval or arguments operand'
|
||||||
return @compileUnary o if @isUnary()
|
return @compileUnary o if @isUnary()
|
||||||
return @compileChain o if isChain
|
return @compileChain o if isChain
|
||||||
return @compileExistence o if @operator is '?'
|
return @compileExistence o if @operator is '?'
|
||||||
|
|
Loading…
Add table
Reference in a new issue