Evaluate [...].join() if possible: minor bugfix

Follow-up to 78e98d2.
This commit is contained in:
Dan Wolff
2013-09-20 06:24:25 +02:00
committed by Mihai Bazon
parent 78e98d2611
commit e8158279ff
2 changed files with 5 additions and 4 deletions

View File

@@ -23,11 +23,13 @@ constant_join: {
var b = [ "foo", 1, 2, 3, "bar" ].join("");
var c = [ boo(), "foo", 1, 2, 3, "bar", bar() ].join("");
var d = [ "foo", 1 + 2 + "bar", "baz" ].join("-");
var e = [].join(foo + bar);
}
expect: {
var a = "foobarbaz";
var b = "foo123bar";
var c = [ boo(), "foo", 1, 2, 3, "bar", bar() ].join(""); // we could still shorten this one, but oh well.
var d = "foo-3bar-baz";
var e = [].join(foo + bar);
}
}