You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Darwin air.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64 i386 MacBookAir5,2 Darwin
Subsystem:
Obviously, this has no impact on production code, as any script execution would die after the first error, but I find it interesting that (console) node goes into this strange state where a declared variable is broken an cannot be "fixed".
This example is just to demonstrate the issue, copy/pasted from a node console:
>letaundefined>a=11>letb=c
ReferenceError: cisnotdefined
at repl:1:9atContextifyScript.Script.runInThisContext(vm.js:44:33)atREPLServer.defaultEval(repl.js:239:29)atbound(domain.js:301:14)atREPLServer.runBound[aseval](domain.js:314:12)atREPLServer.onLine(repl.js:433:10)atemitOne(events.js:120:20)atREPLServer.emit(events.js:210:7)atREPLServer.Interface._onLine(readline.js:278:10)atREPLServer.Interface._line(readline.js:625:8)>b='c'
ReferenceError: bisnotdefined
at repl:1:3atContextifyScript.Script.runInThisContext(vm.js:44:33)atREPLServer.defaultEval(repl.js:239:29)atbound(domain.js:301:14)atREPLServer.runBound[aseval](domain.js:314:12)atREPLServer.onLine(repl.js:433:10)atemitOne(events.js:120:20)atREPLServer.emit(events.js:210:7)atREPLServer.Interface._onLine(readline.js:278:10)atREPLServer.Interface._line(readline.js:625:8)>varb=c
SyntaxError: Identifier'b'hasalreadybeendeclared>b=1
ReferenceError: bisnotdefined
at repl:1:3atContextifyScript.Script.runInThisContext(vm.js:44:33)atREPLServer.defaultEval(repl.js:239:29)atbound(domain.js:301:14)atREPLServer.runBound[aseval](domain.js:314:12)atREPLServer.onLine(repl.js:433:10)atemitOne(events.js:120:20)atREPLServer.emit(events.js:210:7)atREPLServer.Interface._onLine(readline.js:278:10)atREPLServer.Interface._line(readline.js:625:8)>
The text was updated successfully, but these errors were encountered:
DanielSmedegaardBuus
changed the title
Mostly irrelevant, but possibly interesting variable declaration/assignment bug
Mostly irrelevant, but possibly interesting variable declaration/assignment bug with letJun 26, 2017
See #8309 and the issues linked therein, the tl;dr is that the variable (per spec) stays in the TDZ. I'll close this as a duplicate but if anyone has ideas for a workaround, please chime in; see also the comment about the Firefox console in the linked issue.
Obviously, this has no impact on production code, as any script execution would die after the first error, but I find it interesting that (console) node goes into this strange state where a declared variable is broken an cannot be "fixed".
This example is just to demonstrate the issue, copy/pasted from a node console:
The text was updated successfully, but these errors were encountered: