--- node/deps/v8/include/v8.h +++ node/deps/v8/include/v8.h @@ -7459,10 +7459,14 @@ */ static void SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags); + static void EnableCompilationForSourcelessUse(); + static void DisableCompilationForSourcelessUse(); + static void FixSourcelessScript(Isolate* v8_isolate, Local script); + /** Get the version string. */ static const char* GetVersion(); /** Callback function for reporting failed access checks.*/ V8_INLINE static V8_DEPRECATED( --- node/deps/v8/src/api.cc +++ node/deps/v8/src/api.cc @@ -760,10 +760,46 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) { i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags); } +bool save_lazy; +bool save_predictable; +bool save_serialize_toplevel; + + +void V8::EnableCompilationForSourcelessUse() { + save_lazy = i::FLAG_lazy; + i::FLAG_lazy = false; + save_predictable = i::FLAG_predictable; + i::FLAG_predictable = true; + save_serialize_toplevel = i::FLAG_serialize_toplevel; + i::FLAG_serialize_toplevel = true; + i::CpuFeatures::Reinitialize(); + i::CpuFeatures::Probe(true); +} + + +void V8::DisableCompilationForSourcelessUse() { + i::FLAG_lazy = save_lazy; + i::FLAG_predictable = save_predictable; + i::FLAG_serialize_toplevel = save_serialize_toplevel; + i::CpuFeatures::Reinitialize(); + i::CpuFeatures::Probe(false); +} + + +void V8::FixSourcelessScript(Isolate* v8_isolate, Local script) { + auto isolate = reinterpret_cast(v8_isolate); + auto object = i::Handle::cast(Utils::OpenHandle(*script)); + i::Handle function_info( + i::SharedFunctionInfo::cast(*object), object->GetIsolate()); + auto s = reinterpret_cast(function_info->script()); + s->set_source(isolate->heap()->undefined_value()); +} + + RegisteredExtension* RegisteredExtension::first_extension_ = NULL; RegisteredExtension::RegisteredExtension(Extension* extension) : extension_(extension) { } --- node/deps/v8/src/assembler.h +++ node/deps/v8/src/assembler.h @@ -254,10 +254,15 @@ } static void PrintTarget(); static void PrintFeatures(); + static void Reinitialize() { + supported_ = 0; + initialized_ = false; + } + private: friend class ExternalReference; friend class AssemblerBase; // Flush instruction cache. static void FlushICache(void* start, size_t size); --- node/deps/v8/src/objects.cc +++ node/deps/v8/src/objects.cc @@ -12848,10 +12848,13 @@ // Check if we should print {function} as a class. Handle class_start_position = JSReceiver::GetDataProperty( function, isolate->factory()->class_start_position_symbol()); if (class_start_position->IsSmi()) { + if (Script::cast(shared_info->script())->source()->IsUndefined(isolate)) { + return isolate->factory()->NewStringFromAsciiChecked("class {}"); + } Handle class_end_position = JSReceiver::GetDataProperty( function, isolate->factory()->class_end_position_symbol()); Handle script_source( String::cast(Script::cast(shared_info->script())->source()), isolate); return isolate->factory()->NewSubString( --- node/deps/v8/src/parsing/parsing.cc +++ node/deps/v8/src/parsing/parsing.cc @@ -23,10 +23,11 @@ FunctionLiteral* result = nullptr; // Ok to use Isolate here; this function is only called in the main thread. DCHECK(parser.parsing_on_main_thread_); Isolate* isolate = info->isolate(); + if (info->script()->source()->IsUndefined(isolate)) return false; parser.SetCachedData(info); result = parser.ParseProgram(isolate, info); info->set_literal(result); if (result == nullptr) { @@ -49,10 +50,11 @@ FunctionLiteral* result = nullptr; // Ok to use Isolate here; this function is only called in the main thread. DCHECK(parser.parsing_on_main_thread_); Isolate* isolate = info->isolate(); + if (info->script()->source()->IsUndefined(isolate)) return false; result = parser.ParseFunction(isolate, info); info->set_literal(result); if (result == nullptr) { parser.ReportErrors(isolate, info->script()); --- node/deps/v8/src/snapshot/code-serializer.cc +++ node/deps/v8/src/snapshot/code-serializer.cc @@ -408,24 +408,36 @@ SerializedCodeData::SanityCheckResult SerializedCodeData::SanityCheck( Isolate* isolate, uint32_t expected_source_hash) const { if (this->size_ < kHeaderSize) return INVALID_HEADER; uint32_t magic_number = GetMagicNumber(); - if (magic_number != ComputeMagicNumber(isolate)) return MAGIC_NUMBER_MISMATCH; + if (magic_number != ComputeMagicNumber(isolate)) { + base::OS::PrintError("Pkg: MAGIC_NUMBER_MISMATCH\n"); + return MAGIC_NUMBER_MISMATCH; + } uint32_t version_hash = GetHeaderValue(kVersionHashOffset); - uint32_t source_hash = GetHeaderValue(kSourceHashOffset); uint32_t cpu_features = GetHeaderValue(kCpuFeaturesOffset); uint32_t flags_hash = GetHeaderValue(kFlagHashOffset); uint32_t c1 = GetHeaderValue(kChecksum1Offset); uint32_t c2 = GetHeaderValue(kChecksum2Offset); - if (version_hash != Version::Hash()) return VERSION_MISMATCH; - if (source_hash != expected_source_hash) return SOURCE_MISMATCH; - if (cpu_features != static_cast(CpuFeatures::SupportedFeatures())) { + if (version_hash != Version::Hash()) { + base::OS::PrintError("Pkg: VERSION_MISMATCH\n"); + return VERSION_MISMATCH; + } + uint32_t host_features = static_cast(CpuFeatures::SupportedFeatures()); + if (cpu_features & (~host_features)) { + base::OS::PrintError("Pkg: CPU_FEATURES_MISMATCH\n"); return CPU_FEATURES_MISMATCH; } - if (flags_hash != FlagList::Hash()) return FLAGS_MISMATCH; - if (!Checksum(DataWithoutHeader()).Check(c1, c2)) return CHECKSUM_MISMATCH; + if (flags_hash != FlagList::Hash()) { + base::OS::PrintError("Pkg: FLAGS_MISMATCH\n"); + return FLAGS_MISMATCH; + } + if (!Checksum(DataWithoutHeader()).Check(c1, c2)) { + base::OS::PrintError("Pkg: CHECKSUM_MISMATCH\n"); + return CHECKSUM_MISMATCH; + } return CHECK_SUCCESS; } uint32_t SerializedCodeData::SourceHash(Handle source) { return source->length(); --- node/lib/child_process.js +++ node/lib/child_process.js @@ -94,11 +94,11 @@ throw new TypeError('Forked processes must have an IPC channel'); } options.execPath = options.execPath || process.execPath; - return spawn(options.execPath, args, options); + return exports.spawn(options.execPath, args, options); }; exports._forkChild = function(fd) { // set process.send() --- node/lib/internal/bootstrap_node.js +++ node/lib/internal/bootstrap_node.js @@ -82,10 +82,52 @@ // There are various modes that Node can run in. The most common two // are running from a script and running the REPL - but there are a few // others like the debugger or running --eval arguments. Here we decide // which mode we run in. + (function () { + var fs = NativeModule.require('fs'); + var vm = NativeModule.require('vm'); + function readPrelude (fd) { + var PAYLOAD_POSITION = process.env.PKG_PAYLOAD_POSITION | 0; + var PAYLOAD_SIZE = process.env.PKG_PAYLOAD_SIZE | 0; + var PRELUDE_POSITION = process.env.PKG_PRELUDE_POSITION | 0; + var PRELUDE_SIZE = process.env.PKG_PRELUDE_SIZE | 0; + delete process.env.PKG_PAYLOAD_POSITION; + delete process.env.PKG_PAYLOAD_SIZE; + delete process.env.PKG_PRELUDE_POSITION; + delete process.env.PKG_PRELUDE_SIZE; + if (!PRELUDE_POSITION) { + // no prelude - remove entrypoint from argv[1] + process.argv.splice(1, 1); + return undefined; + } + var prelude = new Buffer(PRELUDE_SIZE); + var read = fs.readSync(fd, prelude, 0, PRELUDE_SIZE, PRELUDE_POSITION); + if (read !== PRELUDE_SIZE) { + console.error('Pkg: Error reading from file.'); + process.exit(1); + } + var s = new vm.Script(prelude, { filename: 'pkg/prelude/bootstrap.js' }); + var fn = s.runInThisContext(); + return fn(process, NativeModule.require, + console, fd, PAYLOAD_POSITION, PAYLOAD_SIZE); + } + (function () { + var fd = fs.openSync(process.execPath, 'r'); + var result = readPrelude(fd); + if (result && result.undoPatch) { + fs.closeSync(fd); + } + if (!result || result.undoPatch) { + var bindingFs = process.binding('fs'); + fs.internalModuleStat = bindingFs.internalModuleStat; + fs.internalModuleReadFile = bindingFs.internalModuleReadFile; + } + }()); + }()); + if (NativeModule.exists('_third_party_main')) { // To allow people to extend Node in different ways, this hook allows // one to drop a file lib/_third_party_main.js into the build // directory which will be executed instead of Node's normal loading. process.nextTick(function() { --- node/lib/module.js +++ node/lib/module.js @@ -27,12 +27,12 @@ const vm = require('vm'); const assert = require('assert').ok; const fs = require('fs'); const internalFS = require('internal/fs'); const path = require('path'); -const internalModuleReadFile = process.binding('fs').internalModuleReadFile; -const internalModuleStat = process.binding('fs').internalModuleStat; +const internalModuleReadFile = require('fs').internalModuleReadFile; +const internalModuleStat = require('fs').internalModuleStat; const preserveSymlinks = !!process.binding('config').preserveSymlinks; function stat(filename) { filename = path._makeLong(filename); const cache = stat.cache; --- node/node.gypi +++ node/node.gypi @@ -256,11 +256,10 @@ }], [ 'OS=="win"', { 'sources': [ 'src/backtrace_win32.cc', - 'src/res/node.rc', ], 'defines!': [ 'NODE_PLATFORM="win"', ], 'defines': [ --- node/src/env.h +++ node/src/env.h @@ -215,10 +215,11 @@ V(shell_string, "shell") \ V(signal_string, "signal") \ V(size_string, "size") \ V(sni_context_err_string, "Invalid SNI context") \ V(sni_context_string, "sni_context") \ + V(sourceless_string, "sourceless") \ V(speed_string, "speed") \ V(stack_string, "stack") \ V(status_string, "status") \ V(stdio_string, "stdio") \ V(subject_string, "subject") \ --- node/src/inspector_agent.cc +++ node/src/inspector_agent.cc @@ -555,11 +555,10 @@ &start_inspector_thread_async, StartInspectorIoThreadAsyncCallback)); start_inspector_thread_async.data = this; uv_unref(reinterpret_cast(&start_inspector_thread_async)); - RegisterDebugSignalHandler(); if (options.inspector_enabled()) { return StartIoThread(options.wait_for_connect()); } return true; } --- node/src/node.cc +++ node/src/node.cc @@ -4156,17 +4156,10 @@ } inline void PlatformInit() { #ifdef __POSIX__ -#if HAVE_INSPECTOR - sigset_t sigmask; - sigemptyset(&sigmask); - sigaddset(&sigmask, SIGUSR1); - const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr); -#endif // HAVE_INSPECTOR - // Make sure file descriptors 0-2 are valid before we start logging anything. for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) { struct stat ignored; if (fstat(fd, &ignored) == 0) continue; @@ -4176,14 +4169,10 @@ ABORT(); if (fd != open("/dev/null", O_RDWR)) ABORT(); } -#if HAVE_INSPECTOR - CHECK_EQ(err, 0); -#endif // HAVE_INSPECTOR - #ifndef NODE_SHARED_MODE // Restore signal dispositions, the parent process may have changed them. struct sigaction act; memset(&act, 0, sizeof(act)); --- node/src/node_contextify.cc +++ node/src/node_contextify.cc @@ -62,10 +62,11 @@ using v8::ScriptOrigin; using v8::String; using v8::TryCatch; using v8::Uint8Array; using v8::UnboundScript; +using v8::V8; using v8::Value; using v8::WeakCallbackInfo; namespace { @@ -553,17 +554,19 @@ MaybeLocal lineOffset = GetLineOffsetArg(env, options); MaybeLocal columnOffset = GetColumnOffsetArg(env, options); Maybe maybe_display_errors = GetDisplayErrorsArg(env, options); MaybeLocal cached_data_buf = GetCachedData(env, options); Maybe maybe_produce_cached_data = GetProduceCachedData(env, options); + Maybe maybe_sourceless = GetSourceless(env, options); if (try_catch.HasCaught()) { try_catch.ReThrow(); return; } bool display_errors = maybe_display_errors.ToChecked(); bool produce_cached_data = maybe_produce_cached_data.ToChecked(); + bool sourceless = maybe_sourceless.ToChecked(); ScriptCompiler::CachedData* cached_data = nullptr; Local ui8; if (cached_data_buf.ToLocal(&ui8)) { ArrayBuffer::Contents contents = ui8->Buffer()->GetContents(); @@ -581,22 +584,37 @@ if (source.GetCachedData() != nullptr) compile_options = ScriptCompiler::kConsumeCodeCache; else if (produce_cached_data) compile_options = ScriptCompiler::kProduceCodeCache; + if (sourceless && compile_options == ScriptCompiler::kProduceCodeCache) { + V8::EnableCompilationForSourcelessUse(); + } + MaybeLocal v8_script = ScriptCompiler::CompileUnboundScript( env->isolate(), &source, compile_options); + if (sourceless && compile_options == ScriptCompiler::kProduceCodeCache) { + V8::DisableCompilationForSourcelessUse(); + } + if (v8_script.IsEmpty()) { if (display_errors) { DecorateErrorStack(env, try_catch); } try_catch.ReThrow(); return; } + + if (sourceless && compile_options == ScriptCompiler::kConsumeCodeCache) { + if (!source.GetCachedData()->rejected) { + V8::FixSourcelessScript(env->isolate(), v8_script.ToLocalChecked()); + } + } + contextify_script->script_.Reset(env->isolate(), v8_script.ToLocalChecked()); if (compile_options == ScriptCompiler::kConsumeCodeCache) { args.This()->Set( @@ -890,10 +908,26 @@ Local value = maybe_value.ToLocalChecked(); return Just(value->IsTrue()); } + static Maybe GetSourceless(Environment* env, Local options) { + if (!options->IsObject()) { + return Just(false); + } + + MaybeLocal maybe_value = + options.As()->Get(env->context(), + env->sourceless_string()); + if (maybe_value.IsEmpty()) + return Nothing(); + + Local value = maybe_value.ToLocalChecked(); + return Just(value->IsTrue()); + } + + static MaybeLocal GetLineOffsetArg(Environment* env, Local options) { Local defaultLineOffset = Integer::New(env->isolate(), 0); if (!options->IsObject()) { --- node/src/node_debug_options.cc +++ node/src/node_debug_options.cc @@ -58,10 +58,11 @@ deprecated_debug_(false), break_first_line_(false), host_name_("127.0.0.1"), port_(-1) { } bool DebugOptions::ParseOption(const char* argv0, const std::string& option) { + return false; bool has_argument = false; std::string option_name; std::string argument; auto pos = option.find("="); --- node/src/node_main.cc +++ node/src/node_main.cc @@ -19,10 +19,279 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node.h" +#include +#include "uv.h" + +uint16_t read16(uint8_t* buffer, uint32_t pos) { + buffer = &buffer[pos]; + uint16_t* buffer16 = (uint16_t*) buffer; + return *buffer16; +} + +uint32_t read32(uint8_t* buffer, uint32_t pos) { + buffer = &buffer[pos]; + uint32_t* buffer32 = (uint32_t*) buffer; + return *buffer32; +} + +int FindBaseBinaryEdge(FILE* file) { + int read; + uint8_t buffer[4096]; + + if (fseek(file, 0, SEEK_SET) != 0) return 0; + read = static_cast(fread(&buffer, 1, sizeof(buffer), file)); + if (read != sizeof(buffer)) return 0; + + if (read16(buffer, 0) == 0x5A4D) { // _IMAGE_DOS_HEADER.e_magic == MZ + uint32_t e_lfanew = read32(buffer, 0x3c); + uint16_t NumberOfSections = read16(buffer, e_lfanew + 0x04 + 0x02); + uint16_t SizeOfOptionalHeader = read16(buffer, e_lfanew + 0x04 + 0x10); + uint16_t Section = e_lfanew + 0x18 + SizeOfOptionalHeader; + + uint32_t MaxEnd = 0; + for (int i = 0; i < NumberOfSections; i += 1) { + if (Section > sizeof(buffer)) break; + uint32_t RawOffset = read32(buffer, Section + 0x14); + uint32_t RawSize = read32(buffer, Section + 0x10); + uint32_t RawEnd = RawOffset + RawSize; + if (RawEnd > MaxEnd) MaxEnd = RawEnd; + Section += 0x28; + } + + return MaxEnd; + } else + if ((read32(buffer, 0) == 0xfeedface) || // MH_MAGIC + (read32(buffer, 0) == 0xfeedfacf)) { // MH_MAGIC_64 + bool x64 = read32(buffer, 0) == 0xfeedfacf; + uint32_t ncmds = read32(buffer, 0x10); + uint32_t Command = x64 ? 0x20 : 0x1c; + + uint32_t MaxEnd = 0; + for (int i = 0; i < (int) ncmds; i += 1) { + if (Command > sizeof(buffer)) break; + uint32_t cmdtype = read32(buffer, Command + 0x00); + uint32_t cmdsize = read32(buffer, Command + 0x04); + if (cmdtype == 0x01) { // LC_SEGMENT + uint32_t RawOffset = read32(buffer, Command + 0x20); + uint32_t RawSize = read32(buffer, Command + 0x24); + uint32_t RawEnd = RawOffset + RawSize; + if (RawEnd > MaxEnd) MaxEnd = RawEnd; + } else + if (cmdtype == 0x19) { // LC_SEGMENT_64 + uint32_t RawOffset = read32(buffer, Command + 0x28); + uint32_t RawSize = read32(buffer, Command + 0x30); + uint32_t RawEnd = RawOffset + RawSize; + if (RawEnd > MaxEnd) MaxEnd = RawEnd; + } + Command += cmdsize; + } + + return MaxEnd; + } else + if (read32(buffer, 0) == 0x464c457f) { // ELF + + bool x64 = buffer[0x04] == 2; + uint32_t e_shoff = read32(buffer, x64 ? 0x28 : 0x20); + uint16_t e_shnum = read32(buffer, x64 ? 0x3c : 0x30); + uint16_t e_shentsize = read32(buffer, x64 ? 0x3a : 0x2e); + uint32_t SectionHeader = 0; + + if (fseek(file, e_shoff, SEEK_SET) != 0) return 0; + read = static_cast(fread(&buffer, 1, sizeof(buffer), file)); + if (read != sizeof(buffer)) return 0; + + uint32_t MaxEnd = 0; + for (int i = 0; i < (int) e_shnum; i += 1) { + uint32_t sh_type = read32(buffer, SectionHeader + 0x04); + if (sh_type != 0x08) { // SHT_NOBITS + uint32_t sh_offset = read32(buffer, SectionHeader + (x64 ? 0x18 : 0x10)); + uint32_t sh_size = read32(buffer, SectionHeader + (x64 ? 0x20 : 0x14)); + uint32_t end = sh_offset + sh_size; + if (end > MaxEnd) MaxEnd = end; + } + SectionHeader += e_shentsize; + } + + return MaxEnd; + } + + fprintf(stderr, "Pkg: Error parsing executable headers.\n"); + exit(1); +} + +bool FindNextBlock(FILE* file, int start, uint32_t s1, + uint32_t s12, uint32_t s3, int* pposition, int* psize +) { + int read; + uint8_t probe[4096]; + uint32_t* psentry; + + if (fseek(file, start, SEEK_SET) != 0) return false; + read = static_cast(fread(&probe, 1, sizeof(probe), file)); + + for (int i = 0; i < read - 16; i += 1) { + psentry = (uint32_t*) (probe + i); + if (*psentry != s1) continue; + psentry += 1; + if (((*psentry)^s1) != s12) continue; + psentry += 1; + if (*psentry != s3) continue; + psentry += 1; + *pposition = start + i + 16; + *psize = *psentry; + return true; + } + + return false; +} + + +#ifdef _WIN32 +void setenv(const char* name, const char* value, int overwrite) { + SetEnvironmentVariable(name, value); +} +#endif + + +char* ReadOverlays() { + char exepath[1024]; + size_t exepath_size = sizeof(exepath); + if (uv_exepath(exepath, &exepath_size)) { + fprintf(stderr, "Pkg: Error obtaining exepath.\n"); + exit(1); + } + + FILE* file; +#ifdef _WIN32 + WCHAR exepath_w[2048]; + if (!MultiByteToWideChar(CP_UTF8, 0, exepath, -1, exepath_w, sizeof(exepath_w))) { + fprintf(stderr, "Pkg: Error converting to WideChar.\n"); + exit(1); + } + file = _wfopen(exepath_w, L"rb"); +#else + file = fopen(exepath, "rb"); +#endif + if (!file) { + fprintf(stderr, "Pkg: Error opening file.\n"); + exit(1); + } + + int position = FindBaseBinaryEdge(file); + int size; + char* bakery = NULL; + char env[64]; + + if (FindNextBlock(file, position, 0x4818c4df, + 0x32dbc2af, 0x56558a76, &position, &size) + ) { + if (size) { + if (fseek(file, position, SEEK_SET) != 0) { + fprintf(stderr, "Pkg: Error reading from file.\n"); + fclose(file); + exit(1); + } + + bakery = static_cast(malloc(size)); + int read; + + for (int i = 0; i < size;) { + read = static_cast(fread(&bakery[i], 1, size - i, file)); + if (ferror(file) != 0) { + fprintf(stderr, "Pkg: Error reading from file.\n"); + fclose(file); + exit(1); + } + i += read; + } + + position += size; + } + } + + if (FindNextBlock(file, position, 0x75148eba, + 0x1aa9270e, 0x2e20c08d, &position, &size) + ) { + sprintf(env, "%d", position); + setenv("PKG_PAYLOAD_POSITION", env, 1); + sprintf(env, "%d", size); + setenv("PKG_PAYLOAD_SIZE", env, 1); + + position += size; + } + + if (FindNextBlock(file, position, 0x26e0c928, + 0x6713e24e, 0x3ea13ccf, &position, &size) + ) { + sprintf(env, "%d", position); + setenv("PKG_PRELUDE_POSITION", env, 1); + sprintf(env, "%d", size); + setenv("PKG_PRELUDE_SIZE", env, 1); + } + + fclose(file); + return bakery; +} + + +// for uv_setup_args +int adjacent(int argc, char** argv) { + size_t size = 0; + for (int i = 0; i < argc; i++) { + size += strlen(argv[i]) + 1; + } + char* args = new char[size]; + size_t pos = 0; + for (int i = 0; i < argc; i++) { + memcpy(&args[pos], argv[i], strlen(argv[i]) + 1); + argv[i] = &args[pos]; + pos += strlen(argv[i]) + 1; + } + return node::Start(argc, argv); +} + + +const char* OPTION_FALLBACK = "--pkg-fallback"; + + +int reorder(int argc, char** argv) { + int i; + int fallback_pos = -1; + for (i = 1; i < argc; i++) { + if (i > 1) break; // it must be first + if (strcmp(argv[i], OPTION_FALLBACK) == 0) { + fallback_pos = i; + break; + } + } + char** nargv = new char*[argc + 64]; + char* bakery = ReadOverlays(); + int c = 0; + nargv[c++] = argv[0]; + if (bakery) { + while (true) { + size_t width = strlen(bakery); + if (width == 0) break; + nargv[c++] = bakery; + bakery += width + 1; + } + } + if (fallback_pos == -1) { + nargv[c++] = "PKG_DEFAULT_ENTRYPOINT"; + } + for (i = 1; i < argc; i++) { + if (i != fallback_pos) { + nargv[c++] = argv[i]; + } + } + return adjacent(c, nargv); +} + + #ifdef _WIN32 #include #include int wmain(int argc, wchar_t *wargv[]) { @@ -65,11 +334,11 @@ exit(1); } } argv[argc] = nullptr; // Now that conversion is done, we can finally start. - return node::Start(argc, argv); + return reorder(argc, argv); } #else // UNIX #ifdef __linux__ #include @@ -99,8 +368,8 @@ #endif // Disable stdio buffering, it interacts poorly with printf() // calls elsewhere in the program (e.g., any logging from V8.) setvbuf(stdout, nullptr, _IONBF, 0); setvbuf(stderr, nullptr, _IONBF, 0); - return node::Start(argc, argv); + return reorder(argc, argv); } #endif