From 064e7aa1bbb70baec40a9812a8801627846bde2f Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Thu, 9 May 2013 08:44:24 +0300 Subject: [PATCH] Fix is_assignable (not likely to be noticed, it's only used in `strict` parse mode) --- lib/parse.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/parse.js b/lib/parse.js index c45c064e..c8c5d0a0 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1340,15 +1340,8 @@ function parse($TEXT, options) { function is_assignable(expr) { if (!options.strict) return true; - switch (expr[0]+"") { - case "dot": - case "sub": - case "new": - case "call": - return true; - case "name": - return expr[1] != "this"; - } + if (expr instanceof AST_This) return false; + return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol); }; var maybe_assign = function(no_in) { -- 2.34.1