-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Array(2 ** 32)
makes let and const declarations that can't be initialized.
#53356
Comments
Hi! That part of JavaScript is handled by V8, so if you have an issue with it, I'd recommend you report it there CC @nodejs/v8 to make sure I'm giving the correct information |
Thank you for the information, I'll make sure to submit the issue there! Feel free to close the issue if there's nothing you want to reply with and have a good day/evening! |
https://github.com/nodejs/v8 Wait, the repository is a public archive, where do I need to head to in order to create the issue? Edit: Oh, it's a mirror for chromium's V8 engine... got it. |
|
I'm not actually sure this should be opened in the V8 repository, though. It sounds like you're suggesting that the Node.js REPL should act like the Chrome console. That's (probably) not a V8 issue but something Node.js would handle in its REPL code (or we should at least explain why we don't/can't do that). |
@nodejs/repl |
(Although I guess if the Firefox REPL has the same behavior Node.js does, then maybe there's a case to be made for "We're not going to worry about this until the browsers figure out what the right thing to do is." And if they never do, that's probably OK. This is definitely an edge case. I can't imagine it affects many users.) |
FWIW, it’s not REPL exclusive, and the same behavior happens in scripts like: try{
const x = new Array(2**32);
} catch(e) {}
x = 1
console.log(x) |
@redyetidev I think you're misunderstanding the bug report but maybe @1Git2Clone can confirm.
The problem is the behavior in the REPL that happens after the error is thrown. |
Specifically, it prohibits you from trying to declare the I don't think the And if I'm totally wrong and I'm the one misunderstanding things, my apologies! |
Oh, I misunderstood, my bad. Also, I can't reproduce
|
Probably a duplicate of #8309? |
Oh, I thought it was the exact opposite haha |
FWIW It's also reproducible in #52965, which means it's part of the |
I want to send an update to the participants here, I've taken the report to Chromium already https://issues.chromium.org/issues/345248266 And they marked it as a medium severity priority 2 (P2) issue. If anyone is curious they can continue tracking it on there. Additionally, they marked the topic under Chromium > Blink > Javascript > Language (component id: |
Thanks! I'll curious what they say! |
There is a repl mode provided by V8 that we did not yet implement. It is quite some effort to do so and it was not a high enough priority for contributors. |
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
Subsystem
No response
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
.Additional information
No response
The text was updated successfully, but these errors were encountered: