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 RWK-Mac-2017.local 17.7.0 Darwin Kernel Version 17.7.0: Fri Nov 2 20:43:16 PDT 2018; root:xnu-4570.71.17~1/RELEASE_X86_64 x86_64
Subsystem:
Notice in the following two examples, where state is erroneously redeclared, the "Sync Example", provides this (very useful!) information, which is not present in the Async Example:
/Users/kieffer/work/sync_test.js:4
let state = 123;
^
The "first" line of the stack shown in the async example is not the line on which the error occurred. Rather, it is the line that calls the function containing the error. Unfortunately this can be anywhere, so is completely unhelpful in fixing the problem.
$ node sync_test.js
/Users/kieffer/work/sync_test.js:4
let state = 123;
^
SyntaxError: Identifier 'state' has already been declared
at main (/Users/kieffer/work/sync_test.js:8:3)
at Object.<anonymous> (/Users/kieffer/work/sync_test.js:9:2)
(etc...)
$ node async_test.js
(node:89392) UnhandledPromiseRejectionWarning: SyntaxError: Identifier 'state' has already been declared
at main (/Users/kieffer/work/async_test.js:8:3)
at Object.<anonymous> (/Users/kieffer/work/async_test.js:9:2)
(etc...)
The text was updated successfully, but these errors were encountered:
>node.12.0.0.v8-7.3.2019-01-02.v8-canary.exe test.js
test.js:4
let state = 123;
^^^^^
SyntaxError: Identifier 'state' has already been declared
at new Script (vm.js:84:7)
at createScript (vm.js:264:10)
at Object.runInThisContext (vm.js:312:10)
at Module._compile (internal/modules/cjs/loader.js:681:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:729:10)
at Module.load (internal/modules/cjs/loader.js:617:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:771:12)
at executeUserCode (internal/bootstrap/node.js:434:15)
Notice in the following two examples, where
state
is erroneously redeclared, the "Sync Example", provides this (very useful!) information, which is not present in the Async Example:The "first" line of the stack shown in the async example is not the line on which the error occurred. Rather, it is the line that calls the function containing the error. Unfortunately this can be anywhere, so is completely unhelpful in fixing the problem.
Sync Example:
sync_test.js
Async Example
async_test.js
The text was updated successfully, but these errors were encountered: