[Pkg-javascript-commits] [uglifyjs] 419/491: fix `reduce_vars` on `AST_Accessor` (#2776)
Jonas Smedegaard
dr at jones.dk
Wed Feb 14 19:51:59 UTC 2018
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.
commit e49416e4aaba8d057eefd8d4250fd2ba6c7a4e04
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date: Sat Jan 13 02:46:14 2018 +0800
fix `reduce_vars` on `AST_Accessor` (#2776)
fixes #2774
---
lib/compress.js | 3 ++-
test/compress/reduce_vars.js | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/lib/compress.js b/lib/compress.js
index 21d79b0..b35e453 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -467,8 +467,9 @@ merge(Compressor.prototype, {
if (node instanceof AST_SymbolRef) d.references.push(node);
d.fixed = false;
});
- def(AST_Accessor, function(tw, descend) {
+ def(AST_Accessor, function(tw, descend, compressor) {
push(tw);
+ reset_variables(tw, compressor, this);
descend();
pop(tw);
return true;
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 3d993b9..ec0471a 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -5276,3 +5276,29 @@ duplicate_lambda_defun_name_2: {
}
expect_stdout: "0"
}
+
+issue_2774: {
+ options = {
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log({
+ get a() {
+ var b;
+ (b = true) && b.c;
+ b = void 0;
+ }
+ }.a);
+ }
+ expect: {
+ console.log({
+ get a() {
+ var b;
+ (b = true) && b.c;
+ b = void 0;
+ }
+ }.a);
+ }
+ expect_stdout: "undefined"
+}
--
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