From 685ab357ccda911123539d724de29bc4571a7378 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 16 Jul 2022 17:22:16 +0100 Subject: [PATCH] document v8 quirks (#5565) closes #5564 --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 60ee8145..03ac0314 100644 --- a/README.md +++ b/README.md @@ -1359,7 +1359,7 @@ To allow for better optimizations, the compiler makes various assumptions: // SyntaxError: The left-hand side of a for-of loop may not be 'async'. ``` UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of Chrome and Node.js will give incorrect results with the +- Some versions of Chrome and Node.js will give incorrect results with the following: ```javascript console.log({ @@ -1368,9 +1368,15 @@ To allow for better optimizations, the compiler makes various assumptions: return "FAIL"; }, [42]: "PASS", + }[42], { + ...console, + get 42() { + return "FAIL"; + }, + 42: "PASS", }[42]); - // Expected: "PASS" - // Actual: "FAIL" + // Expected: "PASS PASS" + // Actual: "PASS FAIL" ``` UglifyJS may modify the input which in turn may suppress those errors. - Earlier versions of JavaScript will throw `TypeError` with the following: