From f43ec97e303bbc3189ce049bbff20e454f7ea31b Mon Sep 17 00:00:00 2001 From: Gerald Lewis Date: Mon, 9 Jan 2012 12:59:12 -0500 Subject: [PATCH] Issue #1547 'use strict' delete operands restricted --- src/nodes.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nodes.coffee b/src/nodes.coffee index d50b14c9..e02e0a4e 100644 --- a/src/nodes.coffee +++ b/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 '?'