summaryrefslogtreecommitdiff
path: root/test/message
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-03-04 04:55:45 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-03-06 22:12:46 +0800
commit2a9eb316a1e86d8b191aa2cdfd25d45508456573 (patch)
tree743074a353fc55583bbec14e4d56a27ea0911bc8 /test/message
parent1a5ec837ca56774f2a9ee54ee9a0f6cbfa01d4bc (diff)
downloadandroid-node-v8-2a9eb316a1e86d8b191aa2cdfd25d45508456573.tar.gz
android-node-v8-2a9eb316a1e86d8b191aa2cdfd25d45508456573.tar.bz2
android-node-v8-2a9eb316a1e86d8b191aa2cdfd25d45508456573.zip
src: move internal loaders out of bootstrap_node.js
- Moves the creation of `process.binding()`, `process._linkedBinding()` `internalBinding()` and `NativeModule` into a separate file `lib/internal/bootstrap_loaders.js`, and documents them there. This file will be compiled and run before `bootstrap_node.js`, which means we now bootstrap the internal module & binding system before actually bootstrapping Node.js. - Rename the special ID that can be used to require `NativeModule` as `internal/bootstrap_loaders` since it is setup there. Also put `internalBinding` in the object exported by `NativeModule.require` instead of putting it inside the `NativeModule.wrapper` - Use the original `getBinding()` to get the source code of native modules instead of getting it from `process.binding('native')` so that users cannot fake native modules by modifying the binding object. - Names the bootstrapping functions so their names show up in the stack trace. PR-URL: https://github.com/nodejs/node/pull/19112 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'test/message')
-rw-r--r--test/message/error_exit.out2
-rw-r--r--test/message/eval_messages.out8
-rw-r--r--test/message/events_unhandled_error_common_trace.out2
-rw-r--r--test/message/events_unhandled_error_nexttick.out4
-rw-r--r--test/message/events_unhandled_error_sameline.out4
-rw-r--r--test/message/nexttick_throw.out2
6 files changed, 11 insertions, 11 deletions
diff --git a/test/message/error_exit.out b/test/message/error_exit.out
index 1a3c17bf58..eab43959b6 100644
--- a/test/message/error_exit.out
+++ b/test/message/error_exit.out
@@ -12,4 +12,4 @@ AssertionError [ERR_ASSERTION]: 1 strictEqual 2
at Function.Module._load (module.js:*:*)
at Function.Module.runMain (module.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out
index 6c725cb1cc..7dbf9e950c 100644
--- a/test/message/eval_messages.out
+++ b/test/message/eval_messages.out
@@ -10,7 +10,7 @@ SyntaxError: Strict mode code may not include a with statement
at Module._compile (module.js:*:*)
at evalScript (bootstrap_node.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
42
42
[eval]:1
@@ -25,7 +25,7 @@ Error: hello
at Module._compile (module.js:*:*)
at evalScript (bootstrap_node.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
[eval]:1
throw new Error("hello")
@@ -39,7 +39,7 @@ Error: hello
at Module._compile (module.js:*:*)
at evalScript (bootstrap_node.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
100
[eval]:1
var x = 100; y = x;
@@ -53,7 +53,7 @@ ReferenceError: y is not defined
at Module._compile (module.js:*:*)
at evalScript (bootstrap_node.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
[eval]:1
var ______________________________________________; throw 10
diff --git a/test/message/events_unhandled_error_common_trace.out b/test/message/events_unhandled_error_common_trace.out
index d39a95cb77..1535573470 100644
--- a/test/message/events_unhandled_error_common_trace.out
+++ b/test/message/events_unhandled_error_common_trace.out
@@ -19,4 +19,4 @@ Emitted 'error' event at:
at Module._compile (module.js:*:*)
[... lines matching original stack trace ...]
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
diff --git a/test/message/events_unhandled_error_nexttick.out b/test/message/events_unhandled_error_nexttick.out
index f0591610ff..c578f55f90 100644
--- a/test/message/events_unhandled_error_nexttick.out
+++ b/test/message/events_unhandled_error_nexttick.out
@@ -11,10 +11,10 @@ Error
at Function.Module._load (module.js:*:*)
at Function.Module.runMain (module.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
Emitted 'error' event at:
at process.nextTick (*events_unhandled_error_nexttick.js:*:*)
at process._tickCallback (internal/process/next_tick.js:*:*)
at Function.Module.runMain (module.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
diff --git a/test/message/events_unhandled_error_sameline.out b/test/message/events_unhandled_error_sameline.out
index 100c294276..d8441c44d4 100644
--- a/test/message/events_unhandled_error_sameline.out
+++ b/test/message/events_unhandled_error_sameline.out
@@ -11,9 +11,9 @@ Error
at Function.Module._load (module.js:*:*)
at Function.Module.runMain (module.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
Emitted 'error' event at:
at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*)
at Module._compile (module.js:*:*)
[... lines matching original stack trace ...]
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)
diff --git a/test/message/nexttick_throw.out b/test/message/nexttick_throw.out
index 1c9eca8405..41412b95f6 100644
--- a/test/message/nexttick_throw.out
+++ b/test/message/nexttick_throw.out
@@ -7,4 +7,4 @@ ReferenceError: undefined_reference_error_maker is not defined
at process._tickCallback (internal/process/next_tick.js:*:*)
at Function.Module.runMain (module.js:*:*)
at startup (bootstrap_node.js:*:*)
- at bootstrap_node.js:*:*
+ at bootstrapNodeJSCore (bootstrap_node.js:*:*)