diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-03-20 22:33:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 06:33:45 +0800 |
commit | 8ea1ced389776400cf507cebc48c89f1865c27aa (patch) | |
tree | f29dc0800bb54cc0c6f3383d75c6dda6fc0125da | |
parent | 24619daf684f4ed136616fad616bfb01238d1d30 (diff) | |
download | tracifyjs-8ea1ced389776400cf507cebc48c89f1865c27aa.tar.gz tracifyjs-8ea1ced389776400cf507cebc48c89f1865c27aa.zip |
document various v8 bugs (#4808)
closes #4805
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | test/compress/classes.js | 2 | ||||
-rw-r--r-- | test/compress/loops.js | 5 | ||||
-rw-r--r-- | test/ufuzz/index.js | 51 |
4 files changed, 30 insertions, 41 deletions
@@ -1296,3 +1296,16 @@ To allow for better optimizations, the compiler makes various assumptions: // SyntaxError: Identifier 'e' has already been declared ``` UglifyJS may modify the input which in turn may suppress those errors. +- Some versions of Chrome and Node.js will give incorrect results with the + following: + ```javascript + console.log({ + ...{ + set 42(v) {}, + 42: "PASS", + }, + }); + // Expected: { '42': 'PASS' } + // Actual: { '42': undefined } + ``` + UglifyJS may modify the input which in turn may suppress those errors. diff --git a/test/compress/classes.js b/test/compress/classes.js index 46749a27..7a9dfc51 100644 --- a/test/compress/classes.js +++ b/test/compress/classes.js @@ -725,7 +725,7 @@ unused_await: { (() => console.log(await))(); })(); } - expect_stdout: "PASS" + expect_stdout: true node_version: ">=12" } diff --git a/test/compress/loops.js b/test/compress/loops.js index b1128f1a..5a66e02c 100644 --- a/test/compress/loops.js +++ b/test/compress/loops.js @@ -836,10 +836,7 @@ for_of: { console.log(async); } expect_exact: 'var async=["PASS",42];async.p="FAIL";for(async of(null,async))console.log(async);' - expect_stdout: [ - "PASS", - "42", - ] + expect_stdout: true node_version: ">=0.12" } diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index f7ad29ad..d91fe040 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -158,6 +158,9 @@ var SUPPORT = function(matrix) { template: "``", trailing_comma: "function f(a,) {}", }); +if (SUPPORT.exponentiation && sandbox.run_code("console.log(10 ** 100 === Math.pow(10, 100));") !== "true\n") { + SUPPORT.exponentiation = false; +} var VALUES = [ '"a"', @@ -241,40 +244,13 @@ BINARY_OPS = BINARY_OPS.concat(BINARY_OPS); BINARY_OPS = BINARY_OPS.concat(BINARY_OPS); BINARY_OPS.push(" in "); -var ASSIGNMENTS = [ - "=", - "=", - "=", - "=", - "=", - "=", - "=", - "=", - "=", - "=", - - "=", - "=", - "=", - "=", - "=", - "=", - "=", - "=", - "=", - "=", - - "+=", - "+=", - "+=", - "+=", - "+=", - "+=", - "+=", - "+=", - "+=", - "+=", - +var ASSIGNMENTS = [ "=" ]; +ASSIGNMENTS = ASSIGNMENTS.concat(ASSIGNMENTS); +ASSIGNMENTS.push("+="); +ASSIGNMENTS = ASSIGNMENTS.concat(ASSIGNMENTS); +ASSIGNMENTS = ASSIGNMENTS.concat(ASSIGNMENTS); +ASSIGNMENTS = ASSIGNMENTS.concat(ASSIGNMENTS); +ASSIGNMENTS = ASSIGNMENTS.concat([ "-=", "*=", "/=", @@ -285,8 +261,11 @@ var ASSIGNMENTS = [ "<<=", ">>=", ">>>=", -]; -if (SUPPORT.exponentiation) ASSIGNMENTS.push("**="); +]); +if (SUPPORT.exponentiation) { + ASSIGNMENTS = ASSIGNMENTS.concat(ASSIGNMENTS); + ASSIGNMENTS.push("**="); +} var UNARY_SAFE = [ "+", |