| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ee461fe commit b1500d9
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,8 @@ | |||
| 15 | 15 | // This file is compiled as if it's wrapped in a function with arguments | |
| 16 | 16 | // passed by node::LoadEnvironment() | |
| 17 | 17 | /* global process, bootstrappers, loaderExports, triggerFatalException */ | |
| 18 | + /* global isMainThread */ | ||
| 19 | + | ||
| 18 | 20 | const { | |
| 19 | 21 | _setupTraceCategoryState, | |
| 20 | 22 | _setupNextTick, | |
@@ -28,7 +30,6 @@ const { | |||
| 28 | 30 | const { internalBinding, NativeModule } = loaderExports; | |
| 29 | 31 | ||
| 30 | 32 | const exceptionHandlerState = { captureFn: null }; | |
| 31 | - const isMainThread = internalBinding('worker').threadId === 0; | ||
| 32 | 33 | ||
| 33 | 34 | function startup() { | |
| 34 | 35 | setupTraceCategoryState(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1267,14 +1267,16 @@ void LoadEnvironment(Environment* env) { | |||
| 1267 | 1267 | env->process_string(), | |
| 1268 | 1268 | FIXED_ONE_BYTE_STRING(isolate, "bootstrappers"), | |
| 1269 | 1269 | FIXED_ONE_BYTE_STRING(isolate, "loaderExports"), | |
| 1270 | - FIXED_ONE_BYTE_STRING(isolate, "triggerFatalException")}; | ||
| 1270 | + FIXED_ONE_BYTE_STRING(isolate, "triggerFatalException"), | ||
| 1271 | + FIXED_ONE_BYTE_STRING(isolate, "isMainThread")}; | ||
| 1271 | 1272 | std::vector<Local<Value>> node_args = { | |
| 1272 | 1273 | process, | |
| 1273 | 1274 | bootstrapper, | |
| 1274 | 1275 | loader_exports.ToLocalChecked(), | |
| 1275 | 1276 | env->NewFunctionTemplate(FatalException) | |
| 1276 | 1277 | ->GetFunction(context) | |
| 1277 | - .ToLocalChecked()}; | ||
| 1278 | + .ToLocalChecked(), | ||
| 1279 | + Boolean::New(isolate, env->is_main_thread())}; | ||
| 1278 | 1280 | ||
| 1279 | 1281 | if (ExecuteBootstrapper( | |
| 1280 | 1282 | env, "internal/bootstrap/node", &node_params, &node_args) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ const common = require('../common'); | |||
| 9 | 9 | const assert = require('assert'); | |
| 10 | 10 | ||
| 11 | 11 | const isMainThread = common.isMainThread; | |
| 12 | - const kMaxModuleCount = isMainThread ? 61 : 82; | ||
| 12 | + const kMaxModuleCount = isMainThread ? 60 : 82; | ||
| 13 | 13 | ||
| 14 | 14 | assert(list.length <= kMaxModuleCount, | |
| 15 | 15 | `Total length: ${list.length}\n` + list.join('\n') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments