From f19e968343d136d7b1ce72c7519653f432aed485 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sun, 12 Jun 2016 13:14:34 +0200 Subject: [PATCH 1/4] src: move and update comment about 'node.js' compilation. Currently the comment regarding execution of src/node.js seems to refer to the file before the refactorings done in ec6af31. Also, it looks like the comment itself might have "drifted" a little in the file. Updated the comment to refer to the lib/internal/bootstrap_node.js file, moved it closer to the compilation step, and updated the name that is generated in node_natives.h. --- src/node.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node.cc b/src/node.cc index 0e042137ef6f2e..a54ac8db43693d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3247,9 +3247,6 @@ void LoadEnvironment(Environment* env) { env->isolate()->SetFatalErrorHandler(node::OnFatalError); env->isolate()->AddMessageListener(OnMessage); - // Compile, execute the src/node.js file. (Which was included as static C - // string in node_natives.h. 'native_node' is the string containing that - // source code.) // The node.js file returns a function 'f' atexit(AtExit); @@ -3261,6 +3258,9 @@ void LoadEnvironment(Environment* env) { // are not safe to ignore. try_catch.SetVerbose(false); + // Compile, execute the lib/internal/bootstrap_node.js file. (Which was + // included as static C string in node_natives.h. + // 'internal_bootstrap_node_native is the string containing that source code.) Local script_name = FIXED_ONE_BYTE_STRING(env->isolate(), "node.js"); Local f_value = ExecuteString(env, MainSource(env), script_name); if (try_catch.HasCaught()) { From b35dcce3ccdfffabe20b22cc52b3ed2c66692528 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 13 Jun 2016 16:36:20 +0200 Subject: [PATCH 2/4] Clarifying the comment after suggestions from reviewers. --- src/node.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node.cc b/src/node.cc index a54ac8db43693d..b4f6046b58809f 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3258,9 +3258,9 @@ void LoadEnvironment(Environment* env) { // are not safe to ignore. try_catch.SetVerbose(false); - // Compile, execute the lib/internal/bootstrap_node.js file. (Which was - // included as static C string in node_natives.h. - // 'internal_bootstrap_node_native is the string containing that source code.) + // Execute the lib/internal/bootstrap_node.js file which was included as a + // static in node_natives.h by node_js2c. 'internal_bootstrap_node_native' + // is the string containing that source code. Local script_name = FIXED_ONE_BYTE_STRING(env->isolate(), "node.js"); Local f_value = ExecuteString(env, MainSource(env), script_name); if (try_catch.HasCaught()) { From 481c6287941455bd48c9e1d16e02e23c2b9de0b7 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 14 Jun 2016 15:25:01 +0200 Subject: [PATCH 3/4] src: renaming 'node.js' to 'bootstrap_node.js' --- src/node.cc | 3 ++- test/message/core_line_numbers.out | 2 +- test/message/error_exit.out | 6 +++--- test/message/eval_messages.out | 8 ++++---- test/message/nexttick_throw.out | 6 +++--- test/message/stdin_messages.out | 8 ++++---- test/message/vm_display_runtime_error.out | 2 +- test/message/vm_display_syntax_error.out | 8 ++++---- test/message/vm_dont_display_runtime_error.out | 2 +- test/message/vm_dont_display_syntax_error.out | 4 ++-- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/node.cc b/src/node.cc index b4f6046b58809f..115903be403020 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3261,7 +3261,8 @@ void LoadEnvironment(Environment* env) { // Execute the lib/internal/bootstrap_node.js file which was included as a // static in node_natives.h by node_js2c. 'internal_bootstrap_node_native' // is the string containing that source code. - Local script_name = FIXED_ONE_BYTE_STRING(env->isolate(), "node.js"); + Local script_name = FIXED_ONE_BYTE_STRING(env->isolate(), + "bootstrap_node.js"); Local f_value = ExecuteString(env, MainSource(env), script_name); if (try_catch.HasCaught()) { ReportException(env, try_catch); diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out index 4cd0c0bc857992..b8394e5c3f2deb 100644 --- a/test/message/core_line_numbers.out +++ b/test/message/core_line_numbers.out @@ -12,4 +12,4 @@ RangeError: Invalid input at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*:*) at Module.runMain (module.js:*:*) - at run (node.js:*:*) + at run (bootstrap_node.js:*:*) diff --git a/test/message/error_exit.out b/test/message/error_exit.out index bae71be7795b25..e25af05861b5ce 100644 --- a/test/message/error_exit.out +++ b/test/message/error_exit.out @@ -11,6 +11,6 @@ AssertionError: 1 == 2 at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*:*) at Module.runMain (module.js:*:*) - at run (node.js:*:*) - at startup (node.js:*:*) - at node.js:*:* + at run (bootstrap_node.js:*:*) + at startup (bootstrap_node.js:*:*) + at bootstrap_node.js:*:* diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out index 62f330725606b2..f1b9273342dbc2 100644 --- a/test/message/eval_messages.out +++ b/test/message/eval_messages.out @@ -6,7 +6,7 @@ SyntaxError: Strict mode code may not include a with statement at Object.exports.runInThisContext (vm.js:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) 42 @@ -19,7 +19,7 @@ Error: hello at Object.exports.runInThisContext (vm.js:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) [eval]:1 @@ -30,7 +30,7 @@ Error: hello at Object.exports.runInThisContext (vm.js:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) 100 @@ -42,7 +42,7 @@ ReferenceError: y is not defined at Object.exports.runInThisContext (vm.js:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) [eval]:1 diff --git a/test/message/nexttick_throw.out b/test/message/nexttick_throw.out index bfbd69900b0cbf..9f32dcb6367ffd 100644 --- a/test/message/nexttick_throw.out +++ b/test/message/nexttick_throw.out @@ -7,6 +7,6 @@ ReferenceError: undefined_reference_error_maker is not defined at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) at Module.runMain (module.js:*:*) - at run (node.js:*:*) - at startup (node.js:*:*) - at node.js:*:* + at run (bootstrap_node.js:*:*) + at startup (bootstrap_node.js:*:*) + at bootstrap_node.js:*:* diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out index a7c45a1fbb33fb..1d860918df2fcd 100644 --- a/test/message/stdin_messages.out +++ b/test/message/stdin_messages.out @@ -7,7 +7,7 @@ SyntaxError: Strict mode code may not include a with statement at Object.exports.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) 42 @@ -21,7 +21,7 @@ Error: hello at Object.exports.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) @@ -33,7 +33,7 @@ Error: hello at Object.exports.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) 100 @@ -46,7 +46,7 @@ ReferenceError: y is not defined at Object.exports.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at node.js:*:* + at bootstrap_node.js:*:* at _combinedTickCallback (internal/process/next_tick.js:*:*) at process._tickCallback (internal/process/next_tick.js:*:*) diff --git a/test/message/vm_display_runtime_error.out b/test/message/vm_display_runtime_error.out index c4c9d795587489..9c14783472b000 100644 --- a/test/message/vm_display_runtime_error.out +++ b/test/message/vm_display_runtime_error.out @@ -13,4 +13,4 @@ Error: boo! at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*) at Module.runMain (module.js:*) - at run (node.js:*) + at run (bootstrap_node.js:*) diff --git a/test/message/vm_display_syntax_error.out b/test/message/vm_display_syntax_error.out index a8ee8eea33bac3..8917f2f9d0cbb7 100644 --- a/test/message/vm_display_syntax_error.out +++ b/test/message/vm_display_syntax_error.out @@ -12,8 +12,8 @@ SyntaxError: Unexpected number at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*) at Module.runMain (module.js:*) - at run (node.js:*) - at startup (node.js:*) + at run (bootstrap_node.js:*) + at startup (bootstrap_node.js:*) test.vm:1 var 5; ^ @@ -26,5 +26,5 @@ SyntaxError: Unexpected number at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*) at Module.runMain (module.js:*) - at run (node.js:*) - at startup (node.js:*) + at run (bootstrap_node.js:*) + at startup (bootstrap_node.js:*) diff --git a/test/message/vm_dont_display_runtime_error.out b/test/message/vm_dont_display_runtime_error.out index 189447968775c6..6cc464505f35ba 100644 --- a/test/message/vm_dont_display_runtime_error.out +++ b/test/message/vm_dont_display_runtime_error.out @@ -13,4 +13,4 @@ Error: boo! at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*) at Module.runMain (module.js:*) - at run (node.js:*) + at run (bootstrap_node.js:*) diff --git a/test/message/vm_dont_display_syntax_error.out b/test/message/vm_dont_display_syntax_error.out index e84710a88a02b2..de3daab301890e 100644 --- a/test/message/vm_dont_display_syntax_error.out +++ b/test/message/vm_dont_display_syntax_error.out @@ -12,5 +12,5 @@ SyntaxError: Unexpected number at tryModuleLoad (module.js:*:*) at Function.Module._load (module.js:*) at Module.runMain (module.js:*) - at run (node.js:*) - at startup (node.js:*) + at run (bootstrap_node.js:*) + at startup (bootstrap_node.js:*) From bff57c3c6597f7c1281da38ad579b194526726c4 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 14 Jun 2016 15:43:05 +0200 Subject: [PATCH 4/4] Fixing indentation of "bootstrap_node.js" argument. --- src/node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index 115903be403020..a69133cb99fb32 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3262,7 +3262,7 @@ void LoadEnvironment(Environment* env) { // static in node_natives.h by node_js2c. 'internal_bootstrap_node_native' // is the string containing that source code. Local script_name = FIXED_ONE_BYTE_STRING(env->isolate(), - "bootstrap_node.js"); + "bootstrap_node.js"); Local f_value = ExecuteString(env, MainSource(env), script_name); if (try_catch.HasCaught()) { ReportException(env, try_catch);