From ec64acd2c8d8573abd5b77f8f8946767444841bb Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Sat, 18 Feb 2017 19:34:54 +0800 Subject: introduce `unsafe_proto` - `Array.prototype.slice` => `[].slice` closes #1491 --- test/compress/properties.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') 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"); + } +} -- cgit v1.2.3