node/test/message/stdin_messages.out

90 lines
2.6 KiB
Plaintext
Raw Normal View History

2012-08-02 15:11:09 +00:00
[stdin]
[stdin]:1
with(this){__filename}
^^^^
process: split execution into main scripts This patch splits the execution mode selection from the environment setup in `lib/internal/bootstrap/node.js`, and split the entry point of different execution mode into main scripts under `lib/internal/main`: - `check_syntax.js`: used when `-c`/`--check` which only checks the syntax of the input instead of executing it. - `eval_stdin.js`: used when `-e` is passed without value and stdin is not a TTY (e.g. something is piped). - `eval_string`: used when `-e` is passed along with a string argument - `inspect.js`: for `node inspect`/`node debug` - `print_bash_completion.js`: for `--completion-bash` - `print_help.js`: for `--help` - `prof_process.js`: for `--prof-process` - `repl.js`: for the REPL - `run_main_module.js`: used when a main module is passed - `run_third_party_main.js`: for the legacy `_third_party_main.js` support - `worker_thread.js`: for workers This makes the entry points easier to navigate and paves the way for customized v8 snapshots (that do not need to deserialize execution mode setup) and better embedder APIs. As an example, after this patch, for the most common case where Node.js executes a user module as an entry point, it essentially goes through: - `lib/internal/per_context.js` to setup the v8 Context (which is also run when setting up contexts for the `vm` module) - `lib/internal/bootstrap/loaders.js` to set up internal binding and builtin module loaders (that are separate from the loaders accessible in the user land). - `lib/internal/bootstrap/node.js`: to set up the rest of the environment, including various globals and the process object - `lib/internal/main/run_main_module.js`: which is selected from C++ to prepare execution of the user module. This patch also removes `NativeModuleLoader::CompileAndCall` and exposes `NativeModuleLoader::LookupAndCompile` directly so that we can handle syntax errors and runtime errors of bootstrap scripts differently. PR-URL: https://github.com/nodejs/node/pull/25667 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-15 15:12:21 +00:00
2012-08-02 15:11:09 +00:00
SyntaxError: Strict mode code may not include a with statement
at makeContextifyScript (node:internal/vm:*:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
at process.processTicksAndRejections (node:internal/process/task_queues:*:*)
Node.js *
2012-08-02 15:11:09 +00:00
42
42
[stdin]:1
throw new Error("hello")
^
2012-08-02 15:11:09 +00:00
Error: hello
at [stdin]:1:7
at runScriptInThisContext (node:internal/vm:*:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
Node.js *
2012-08-02 15:11:09 +00:00
[stdin]:1
throw new Error("hello")
^
2012-08-02 15:11:09 +00:00
Error: hello
at [stdin]:1:*
at runScriptInThisContext (node:internal/vm:*:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
Node.js *
2012-08-02 15:11:09 +00:00
100
[stdin]:1
let x = 100; y = x;
2012-08-02 15:11:09 +00:00
^
2012-08-02 15:11:09 +00:00
ReferenceError: y is not defined
at [stdin]:1:16
at runScriptInThisContext (node:internal/vm:*:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
2012-08-02 15:11:09 +00:00
Node.js *
2012-08-02 15:11:09 +00:00
[stdin]:1
let ______________________________________________; throw 10
2012-08-02 15:11:09 +00:00
^
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)
2012-08-02 15:11:09 +00:00
Node.js *
2012-08-02 15:11:09 +00:00
[stdin]:1
let ______________________________________________; throw 10
2012-08-02 15:11:09 +00:00
^
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
2012-08-02 15:11:09 +00:00
done