[Pkg-javascript-commits] [uglifyjs] 124/228: throw parse error on invalid assignments (#1627)

Jonas Smedegaard dr at jones.dk
Sat Apr 15 14:25:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository uglifyjs.

commit 4bceb85cbfa2c944fb97bb3baaa403b266d075c6
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Tue Mar 21 14:11:32 2017 +0800

    throw parse error on invalid assignments (#1627)
    
    fixes #1626
---
 lib/parse.js                   |  4 +---
 test/compress/html_comments.js | 16 ----------------
 2 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/lib/parse.js b/lib/parse.js
index 25fe931..4d37b85 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -1501,9 +1501,7 @@ function parse($TEXT, options) {
     };
 
     function is_assignable(expr) {
-        if (!options.strict) return true;
-        if (expr instanceof AST_This) return false;
-        return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);
+        return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef;
     };
 
     var maybe_assign = function(no_in) {
diff --git a/test/compress/html_comments.js b/test/compress/html_comments.js
index 8495b43..fe6ff8a 100644
--- a/test/compress/html_comments.js
+++ b/test/compress/html_comments.js
@@ -47,22 +47,6 @@ html_comment_in_greater_than_or_equal: {
     expect_exact: "function f(a,b){return a-- >=b}";
 }
 
-html_comment_in_right_shift_assign: {
-    input: {
-        // Note: illegal javascript
-        function f(a, b) { return a-- >>= b; }
-    }
-    expect_exact: "function f(a,b){return a-- >>=b}";
-}
-
-html_comment_in_zero_fill_right_shift_assign: {
-    input: {
-        // Note: illegal javascript
-        function f(a, b) { return a-- >>>= b; }
-    }
-    expect_exact: "function f(a,b){return a-- >>>=b}";
-}
-
 html_comment_in_string_literal: {
     input: {
         function f() { return "<!--HTML-->comment in<!--string literal-->"; }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list