aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Wolff <dan.d.wolff@gmail.com>2014-07-01 00:51:42 +0200
committerMihai Bazon <mihai@bazon.net>2014-07-01 11:06:51 +0300
commit8511e80f489b4b7e3de8122009d492123a314ca8 (patch)
treed7b841c436e6d2d7e008ddafeeb832c4cec4e82d /test
parent91bc3f1f92b0d4e75ff40364458121e3df961cd0 (diff)
downloadtracifyjs-8511e80f489b4b7e3de8122009d492123a314ca8.tar.gz
tracifyjs-8511e80f489b4b7e3de8122009d492123a314ca8.zip
Evaluate "foo".length ==> 3
Diffstat (limited to 'test')
-rw-r--r--test/compress/properties.js20
1 files changed, 20 insertions, 0 deletions
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;
+ }
+}