make tests compatible with Node.js 12 (#3304)
authorsilverwind <me@silverwind.io>
Tue, 12 Mar 2019 20:55:04 +0000 (21:55 +0100)
committerAlex Lam S.L <alexlamsl@gmail.com>
Tue, 12 Mar 2019 20:55:04 +0000 (04:55 +0800)
commit9aae4f2424b728f49f1c7cf6908758a077435862
tree6d47534ed5735d4a155549794c3c7a66b1116f55
parent008c23613769a34e48129a5671f6ea22a989d171
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
test/compress/evaluate.js
test/compress/reduce_vars.js