diff options
author | alexlamsl <alexlamsl@gmail.com> | 2017-02-18 19:34:54 +0800 |
---|---|---|
committer | alexlamsl <alexlamsl@gmail.com> | 2017-02-21 13:29:58 +0800 |
commit | ec64acd2c8d8573abd5b77f8f8946767444841bb (patch) | |
tree | 73f4bbbfe5298777ae1ef19ae711d2c9dacb60dd /test | |
parent | ac0b61ed6e1bce4794100c5bb83f6e5b22996d8a (diff) | |
download | tracifyjs-ec64acd2c8d8573abd5b77f8f8946767444841bb.tar.gz tracifyjs-ec64acd2c8d8573abd5b77f8f8946767444841bb.zip |
introduce `unsafe_proto`
- `Array.prototype.slice` => `[].slice`
closes #1491
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/properties.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/compress/properties.js b/test/compress/properties.js index 7ad54ebe..29bdfe2a 100644 --- a/test/compress/properties.js +++ b/test/compress/properties.js @@ -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"); + } +} |