Evaluate "foo".length ==> 3

This commit is contained in:
Dan Wolff
2014-07-01 00:51:42 +02:00
committed by Mihai Bazon
parent 91bc3f1f92
commit 8511e80f48
2 changed files with 33 additions and 1 deletions

View File

@@ -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;
}
}