From 8511e80f489b4b7e3de8122009d492123a314ca8 Mon Sep 17 00:00:00 2001 From: Dan Wolff Date: Tue, 1 Jul 2014 00:51:42 +0200 Subject: Evaluate "foo".length ==> 3 --- test/compress/properties.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/compress/properties.js') diff --git a/test/compress/properties.js b/test/compress/properties.js index 736d9d88..39470738 100644 --- a/test/compress/properties.js +++ b/test/compress/properties.js @@ -52,3 +52,23 @@ dot_properties_es5: { a[""] = "whitespace"; } } + +evaluate_length: { + options = { + properties: true, + unsafe: true, + evaluate: true + }; + input: { + a = "foo".length; + a = ("foo" + "bar")["len" + "gth"]; + a = b.length; + a = ("foo" + b).length; + } + expect: { + a = 3; + a = 6; + a = b.length; + a = ("foo" + b).length; + } +} -- cgit v1.2.3