2015-07-31 13:56:33 +00:00
|
|
|
dont_reuse_prop: {
|
2017-07-29 15:02:04 +00:00
|
|
|
mangle = {
|
|
|
|
|
properties: {
|
|
|
|
|
regex: /asd/,
|
|
|
|
|
},
|
2017-06-23 07:53:13 +00:00
|
|
|
}
|
2015-07-31 13:56:33 +00:00
|
|
|
input: {
|
2017-06-23 07:53:13 +00:00
|
|
|
"aaaaaaaaaabbbbb";
|
2015-07-31 13:56:33 +00:00
|
|
|
var obj = {};
|
|
|
|
|
obj.a = 123;
|
|
|
|
|
obj.asd = 256;
|
|
|
|
|
console.log(obj.a);
|
|
|
|
|
}
|
|
|
|
|
expect: {
|
2017-06-23 07:53:13 +00:00
|
|
|
"aaaaaaaaaabbbbb";
|
2015-07-31 13:56:33 +00:00
|
|
|
var obj = {};
|
|
|
|
|
obj.a = 123;
|
|
|
|
|
obj.b = 256;
|
|
|
|
|
console.log(obj.a);
|
|
|
|
|
}
|
2017-06-23 07:53:13 +00:00
|
|
|
expect_stdout: "123"
|
2022-08-18 18:32:21 +00:00
|
|
|
expect_warnings: [
|
|
|
|
|
"INFO: Preserving excluded property a",
|
|
|
|
|
"INFO: Preserving reserved property log",
|
|
|
|
|
"INFO: Mapping property asd to b",
|
|
|
|
|
]
|
2015-07-31 13:56:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unmangleable_props_should_always_be_reserved: {
|
2017-07-29 15:02:04 +00:00
|
|
|
mangle = {
|
|
|
|
|
properties: {
|
|
|
|
|
regex: /asd/,
|
|
|
|
|
},
|
2017-06-23 07:53:13 +00:00
|
|
|
}
|
2015-07-31 13:56:33 +00:00
|
|
|
input: {
|
2017-06-23 07:53:13 +00:00
|
|
|
"aaaaaaaaaabbbbb";
|
2015-07-31 13:56:33 +00:00
|
|
|
var obj = {};
|
|
|
|
|
obj.asd = 256;
|
|
|
|
|
obj.a = 123;
|
|
|
|
|
console.log(obj.a);
|
|
|
|
|
}
|
|
|
|
|
expect: {
|
2017-06-23 07:53:13 +00:00
|
|
|
"aaaaaaaaaabbbbb";
|
2015-07-31 13:56:33 +00:00
|
|
|
var obj = {};
|
|
|
|
|
obj.b = 256;
|
|
|
|
|
obj.a = 123;
|
|
|
|
|
console.log(obj.a);
|
|
|
|
|
}
|
2017-06-23 07:53:13 +00:00
|
|
|
expect_stdout: "123"
|
2022-08-18 18:32:21 +00:00
|
|
|
expect_warnings: [
|
|
|
|
|
"INFO: Preserving excluded property a",
|
|
|
|
|
"INFO: Preserving reserved property log",
|
|
|
|
|
"INFO: Mapping property asd to b",
|
|
|
|
|
]
|
2017-06-23 07:53:13 +00:00
|
|
|
}
|