introduce unsafe_proto

- `Array.prototype.slice` => `[].slice`

closes #1491
This commit is contained in:
alexlamsl
2017-02-18 19:34:54 +08:00
parent ac0b61ed6e
commit ec64acd2c8
3 changed files with 42 additions and 0 deletions

View File

@@ -539,3 +539,19 @@ first_256_hex_chars_as_properties: {
};
}
}
native_prototype: {
options = {
unsafe_proto: true,
}
input: {
Array.prototype.splice.apply(a, [1, 2, b, c]);
Object.prototype.hasOwnProperty.call(d, "foo");
String.prototype.indexOf.call(e, "bar");
}
expect: {
[].splice.apply(a, [1, 2, b, c]);
({}).hasOwnProperty.call(d, "foo");
"".indexOf.call(e, "bar");
}
}