diff options
author | silverwind <me@silverwind.io> | 2019-03-12 21:55:04 +0100 |
---|---|---|
committer | Alex Lam S.L <alexlamsl@gmail.com> | 2019-03-13 04:55:04 +0800 |
commit | 9aae4f2424b728f49f1c7cf6908758a077435862 (patch) | |
tree | 6d47534ed5735d4a155549794c3c7a66b1116f55 /test | |
parent | 008c23613769a34e48129a5671f6ea22a989d171 (diff) | |
download | tracifyjs-9aae4f2424b728f49f1c7cf6908758a077435862.tar.gz tracifyjs-9aae4f2424b728f49f1c7cf6908758a077435862.zip |
make tests compatible with Node.js 12 (#3304)
In Node.js 12, the formatting of console arguments will change slightly.
Previously, a string other than the first argument was formatted using
single quotes if the first argument was non-string. Now, quotes are
never added regardless of position of a string argument.
To make test compatible in all Node.js versions, I work around by
ensuring the first argument to console.log is a string which prevents
the quotes from being added on older versions of Node.js.
Ref: https://github.com/nodejs/node/pull/23162
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/evaluate.js | 12 | ||||
-rw-r--r-- | test/compress/reduce_vars.js | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 53fe8d96..c1cb86cd 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -1245,12 +1245,12 @@ self_comparison_1: { } input: { var o = { n: NaN }; - console.log(o.n == o.n, o.n === o.n, o.n != o.n, o.n !== o.n, typeof o.n); + console.log(typeof o.n, o.n == o.n, o.n === o.n, o.n != o.n, o.n !== o.n); } expect: { - console.log(false, false, true, true, "number"); + console.log("number", false, false, true, true); } - expect_stdout: "false false true true 'number'" + expect_stdout: "number false false true true" } self_comparison_2: { @@ -1265,12 +1265,12 @@ self_comparison_2: { } input: { var o = { n: NaN }; - console.log(o.n == o.n, o.n === o.n, o.n != o.n, o.n !== o.n, typeof o.n); + console.log(typeof o.n, o.n == o.n, o.n === o.n, o.n != o.n, o.n !== o.n); } expect: { - console.log(false, false, true, true, "number"); + console.log("number", false, false, true, true); } - expect_stdout: "false false true true 'number'" + expect_stdout: "number false false true true" } issue_2535_1: { diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index b040a3f7..0bb682ab 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -2740,18 +2740,18 @@ issue_1814_2: { !function() { var b = a + 1; !function(a) { - console.log(a++, b); + console.log(b, a++); }(0); }(); } expect: { !function() { !function(a) { - console.log(a++, "321"); + console.log("321", a++); }(0); }(); } - expect_stdout: "0 '321'" + expect_stdout: "321 0" } try_abort: { |