if (in_try(level, parent instanceof AST_Throw)) break;
if (is_reachable(def.scope, [ def ])) break;
if (self.operator == "=") return self.right;
+ def.fixed = false;
return make_node(AST_Binary, self, {
operator: self.operator.slice(0, -1),
left: self.left,
z;
}
}
+
+issue_2860_1: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ reduce_vars: true,
+ }
+ input: {
+ console.log(function(a) {
+ return a ^= 1;
+ }());
+ }
+ expect: {
+ console.log(function(a) {
+ return 1 ^ a;
+ }());
+ }
+ expect_stdout: "1"
+}
+
+issue_2860_2: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ inline: true,
+ passes: 2,
+ reduce_vars: true,
+ }
+ input: {
+ console.log(function(a) {
+ return a ^= 1;
+ }());
+ }
+ expect: {
+ console.log(1);
+ }
+ expect_stdout: "1"
+}
}
expect_stdout: "5eadbeef"
}
+
+issue_2860_1: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ reduce_vars: true,
+ }
+ input: {
+ console.log(function(a) {
+ return a ^= 1;
+ a ^= 2;
+ }());
+ }
+ expect: {
+ console.log(function(a) {
+ return 1 ^ a;
+ }());
+ }
+ expect_stdout: "1"
+}
+
+issue_2860_2: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ inline: true,
+ passes: 2,
+ reduce_vars: true,
+ }
+ input: {
+ console.log(function(a) {
+ return a ^= 1;
+ a ^= 2;
+ }());
+ }
+ expect: {
+ console.log(1);
+ }
+ expect_stdout: "1"
+}