path: root/.travis.yml
blob: 6ebec86bbc1be01f064cb9a284fa895a88fc94fc (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - libstdc++-4.9-dev
cache:
  directories: tmp
language: generic
matrix:
  fast_finish: true
sudo: false
env:
  global:
    - UGLIFYJS_TEST_ALL=1
  matrix:
    - NODEJS_VER=node/0.10
    - NODEJS_VER=node/0.12
    - NODEJS_VER=node/4
    - NODEJS_VER=node/6
    - NODEJS_VER=node/8
    - NODEJS_VER=node/latest
before_install:
  - git clone --branch v1.4.2 --depth 1 https://github.com/jasongin/nvs.git ~/.nvs
  - . ~/.nvs/nvs.sh
  - nvs --version
install:
  - nvs add $NODEJS_VER
  - nvs use $NODEJS_VER
  - node --version
  - npm --version --no-update-notifier
  - npm install --no-optional --no-save --no-update-notifier
script:
  - npm test --no-update-notifier
--r--test/compress/sequences.js2
3 files changed, 24 insertions, 10 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index 78c0ca24..a208165f 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -1416,3 +1416,22 @@ issue_3271: {
}
expect_stdout: "1 1"
}
+
+iife_condition: {
+ options = {
+ conditionals: true,
+ side_effects: true,
+ }
+ input: {
+ if (function() {
+ return console;
+ }())
+ console.log("PASS");
+ }
+ expect: {
+ !function() {
+ return console;
+ }() || console.log("PASS");
+ }
+ expect_stdout: "PASS"
+}
diff --git a/test/compress/issue-1639.js b/test/compress/issue-1639.js
index 80d45a76..1579e06e 100644
--- a/test/compress/issue-1639.js
+++ b/test/compress/issue-1639.js
@@ -1,4 +1,3 @@
-
issue_1639_1: {
options = {
booleans: true,
@@ -12,7 +11,6 @@ issue_1639_1: {
}
input: {
var a = 100, b = 10;
-
var L1 = 5;
while (--L1 > 0) {
if ((--b), false) {
@@ -21,7 +19,6 @@ issue_1639_1: {
}
}
}
-
console.log(a, b);
}
expect: {
@@ -29,7 +26,7 @@ issue_1639_1: {
if (--b, 0) var ignore = 0;
console.log(a, b);
}
- expect_stdout: true
+ expect_stdout: "100 6"
}
issue_1639_2: {
@@ -44,25 +41,23 @@ issue_1639_2: {
}
input: {
var a = 100, b = 10;
-
function f19() {
if (++a, false)
if (a)
if (++a);
}
f19();
-
console.log(a, b);
}
expect: {
var a = 100, b = 10;
function f19() {
- ++a, 0;
+ ++a, 1;
}
f19(),
console.log(a, b);
}
- expect_stdout: true
+ expect_stdout: "101 10"
}
issue_1639_3: {
@@ -84,5 +79,5 @@ issue_1639_3: {
a++,
console.log(a, b);
}
- expect_stdout: true
+ expect_stdout: "101 10"
}
diff --git a/test/compress/sequences.js b/test/compress/sequences.js
index 0670ab53..29cede40 100644
--- a/test/compress/sequences.js
+++ b/test/compress/sequences.js
@@ -702,7 +702,7 @@ side_effects_cascade_3: {
}
expect: {
function f(a, b) {
- !(b += a) && ((b = a) || (b -= a, b ^= a)),
+ (b += a) || (b = a) || (b -= a, b ^= a),
a--;
}
}