Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-22 20:04:46 +0300
committerMichaël Zasso <targos@protonmail.com>2019-11-25 12:28:15 +0300
commit0646eda4fc0affb98e13c30acb522e63b7fd6dde (patch)
tree078209f50b044e24ea2c72cbbe7dca6e34bb7e25 /lib/internal/main
parent35c6e0cc2b56a5380e6808ef5603ecc2b167e032 (diff)
lib: flatten access to primordials
Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'lib/internal/main')
-rw-r--r--lib/internal/main/worker_thread.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js
index 13d7e8de0ec..95fa3026fda 100644
--- a/lib/internal/main/worker_thread.js
+++ b/lib/internal/main/worker_thread.js
@@ -3,7 +3,9 @@
// In worker threads, execute the script sent through the
// message port.
-const { Object } = primordials;
+const {
+ ObjectDefineProperty,
+} = primordials;
const {
patchProcessObject,
@@ -72,12 +74,12 @@ const port = getEnvMessagePort();
// related IPC properties as unavailable.
if (process.env.NODE_CHANNEL_FD) {
const workerThreadSetup = require('internal/process/worker_thread_only');
- Object.defineProperty(process, 'channel', {
+ ObjectDefineProperty(process, 'channel', {
enumerable: false,
get: workerThreadSetup.unavailable('process.channel')
});
- Object.defineProperty(process, 'connected', {
+ ObjectDefineProperty(process, 'connected', {
enumerable: false,
get: workerThreadSetup.unavailable('process.connected')
});