Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #1547 'use strict' delete operands restricted

  • Loading branch information...
commit f43ec97e303bbc3189ce049bbff20e454f7ea31b 1 parent 7521068
@geraldalewis geraldalewis authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/nodes.coffee
View
4 src/nodes.coffee
@@ -1467,6 +1467,10 @@ exports.Op = class Op extends Base
# In chains, there's no need to wrap bare obj literals in parens,
# as the chained expression is wrapped.
@first.front = @front unless isChain
+ if @operator is 'delete' and o.scope.check(@first.unwrapAll().value)
+ throw SyntaxError 'delete operand may not be argument or var'
+ if @operator in ['--', '++'] and @first.unwrapAll().value in STRICT_PROSCRIBED
+ throw SyntaxError 'prefix increment/decrement may not have eval or arguments operand'
return @compileUnary o if @isUnary()
return @compileChain o if isChain
return @compileExistence o if @operator is '?'
Please sign in to comment.
Something went wrong with that request. Please try again.