aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2013-10-24 02:39:07 -0700
committerMihai Bazon <mihai.bazon@gmail.com>2013-10-24 02:39:07 -0700
commitcfd5c6155c4774b4def6711c5159d9080148a7ae (patch)
tree2ba5995f6e369d336bae43b243055dd5a7f88ece /test
parent63e1a8e1fd17958557f41a55ea08d678b7995f9b (diff)
parent1a5a4bd63185e38eb550a9b0ca85890002d5243a (diff)
downloadtracifyjs-cfd5c6155c4774b4def6711c5159d9080148a7ae.tar.gz
tracifyjs-cfd5c6155c4774b4def6711c5159d9080148a7ae.zip
Merge pull request #325 from rvanvelzen/fix-269
Fix #269
Diffstat (limited to 'test')
-rw-r--r--test/compress/issue-269.js68
1 files changed, 68 insertions, 0 deletions
diff --git a/test/compress/issue-269.js b/test/compress/issue-269.js
new file mode 100644
index 00000000..70e82d08
--- /dev/null
+++ b/test/compress/issue-269.js
@@ -0,0 +1,68 @@
+issue_269_1: {
+ options = {unsafe: true};
+ input: {
+ f(
+ String(x),
+ Number(x),
+ Boolean(x),
+
+ String(),
+ Number(),
+ Boolean()
+ );
+ }
+ expect: {
+ f(
+ x + '', +x, !!x,
+ '', 0, false
+ );
+ }
+}
+
+issue_269_dangers: {
+ options = {unsafe: true};
+ input: {
+ f(
+ String(x, x),
+ Number(x, x),
+ Boolean(x, x)
+ );
+ }
+ expect: {
+ f(String(x, x), Number(x, x), Boolean(x, x));
+ }
+}
+
+issue_269_in_scope: {
+ options = {unsafe: true};
+ input: {
+ var String, Number, Boolean;
+ f(
+ String(x),
+ Number(x, x),
+ Boolean(x)
+ );
+ }
+ expect: {
+ var String, Number, Boolean;
+ f(String(x), Number(x, x), Boolean(x));
+ }
+}
+
+strings_concat: {
+ options = {unsafe: true};
+ input: {
+ f(
+ String(x + 'str'),
+ String('str' + x),
+ String(x + 5)
+ );
+ }
+ expect: {
+ f(
+ x + 'str',
+ 'str' + x,
+ x + '5'
+ );
+ }
+} \ No newline at end of file