WAI
Status Update
Comments
ma...@chromium.org <ma...@chromium.org> #2
As mentioned in the Node bug ( https://github.com/nodejs/node/issues/53356#issuecomment-2150650305 ), this is about how REPLs are implemented in Chromium and Firefox and Node, and the inconsistencies there. This area is not specced, so implementations can do whatever. Of course it would be ideal to have this consistent across browsers / runtimes, but fixing this overall situation (creating a REPL spec?) might not be high priority for anyone at this point.
As Chromium implements the "wanted" behavior but Node doesn't, this is not something we can change on the V8 side.
As Chromium implements the "wanted" behavior but Node doesn't, this is not something we can change on the V8 side.
iv...@gmail.com <iv...@gmail.com> #3 Restricted+
Restricted+
Comment has been deleted.
iv...@gmail.com <iv...@gmail.com> #4
Thank you for the response, I wish you have a good day/evening!
Description
Inconsistencies in assigning let and const values to
new Array(2 ** 32)
in NodeJS and ChromiumThere are some inconsistencies in the processing let and const declarations that are new arrays whose length surpass the integer limit (2^32 and higher). This is the full report for how it's processed in NodeJS (also shows the differences between NodeJS's V8, Chromium's V8 and Firefox's Gecko engines).
This report was done on NodeJS's GitHub page already as I got referred to report it on here instead.
The text below here is the same as the aforementioned GitHub report of the issue.
Version
v22.2.0
Platform
Linux hutao 6.9.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 31 May 2024 15:14:45 +0000 x86_64 GNU/Linux
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Consistently reproducable via making a variable which stores a
new Array
that has a length higher than the limit (2^32 - 1
).What is the expected behavior? Why is that the expected behavior?
The same way the chromium developer console handles it by disallowing the declaration of the variable all together.
I mean it only makes sense, especially in
const
where it'd be weird to have a constant that's not defined (despite it being in JavaScript).Although to be honest this is also an issue with
const
values even in Firefox...Chromium - handles it correctly because it's not allowing for undefined
const
valuesFirefox - how can you have an undefined
const
?What do you see instead?
Undefined
const
variable:z
as well as a declared (but inaccessible)let
variable:x
.