drop property assignment to constants (#2612)

This commit is contained in:
Alex Lam S.L
2017-12-18 12:07:53 +08:00
committed by GitHub
parent b29fc8b27c
commit 0b0eac1d5d
2 changed files with 53 additions and 2 deletions

View File

@@ -1054,3 +1054,43 @@ issue_2513: {
"undefined undefined",
]
}
const_prop_assign_strict: {
options = {
pure_getters: "strict",
side_effects: true,
}
input: {
function Simulator() {
/abc/.index = 1;
this._aircraft = [];
}
(function() {}).prototype.destroy = x();
}
expect: {
function Simulator() {
this._aircraft = [];
}
x();
}
}
const_prop_assign_pure: {
options = {
pure_getters: true,
side_effects: true,
}
input: {
function Simulator() {
/abc/.index = 1;
this._aircraft = [];
}
(function() {}).prototype.destroy = x();
}
expect: {
function Simulator() {
this._aircraft = [];
}
x();
}
}