Skip to content
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

REPL: variable (re)definition doesn't work when exception in object construction #22476

Closed
freiit opened this issue Aug 23, 2018 · 1 comment
Closed
Labels
question Issues that look for answers.

Comments

@freiit
Copy link

freiit commented Aug 23, 2018

Version: v8.11.4, v10.9.0
Platform: all

$ node

class X { constructor() { throw "broken" }}
undefined
let b = new X()
Thrown: broken
b=1
ReferenceError: b is not defined
let b = 1
SyntaxError: Identifier 'b' has already been declared

Expected to be able overwrite b with "b=11" or redefine b with "let b=1".

@ghost
Copy link

ghost commented Aug 23, 2018

Dupe of #22181 and #8309. It's working per spec, not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

2 participants