- Version: v8.1.0 (Homebrewed)
- 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)>
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: