aboutsummaryrefslogtreecommitdiff
path: root/lib/internal/bootstrap/loaders.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/bootstrap/loaders.js')
-rw-r--r--lib/internal/bootstrap/loaders.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
index 1915dc6674..cfefc56bd8 100644
--- a/lib/internal/bootstrap/loaders.js
+++ b/lib/internal/bootstrap/loaders.js
@@ -44,15 +44,17 @@
/* global process, getLinkedBinding, getInternalBinding, primordials */
const {
- Reflect,
- Object,
- ObjectPrototype,
- SafeSet
+ ReflectGet,
+ ObjectCreate,
+ ObjectDefineProperty,
+ ObjectKeys,
+ ObjectPrototypeHasOwnProperty,
+ SafeSet,
} = primordials;
// Set up process.moduleLoadList.
const moduleLoadList = [];
-Object.defineProperty(process, 'moduleLoadList', {
+ObjectDefineProperty(process, 'moduleLoadList', {
value: moduleLoadList,
configurable: true,
enumerable: true,
@@ -98,7 +100,7 @@ const internalBindingWhitelist = new SafeSet([
// Set up process.binding() and process._linkedBinding().
{
- const bindingObj = Object.create(null);
+ const bindingObj = ObjectCreate(null);
process.binding = function binding(module) {
module = String(module);
@@ -123,7 +125,7 @@ const internalBindingWhitelist = new SafeSet([
// Set up internalBinding() in the closure.
let internalBinding;
{
- const bindingObj = Object.create(null);
+ const bindingObj = ObjectCreate(null);
// eslint-disable-next-line no-global-assign
internalBinding = function internalBinding(module) {
let mod = bindingObj[module];
@@ -222,7 +224,7 @@ NativeModule.prototype.compileForPublicLoader = function() {
// When using --expose-internals, we do not want to reflect the named
// exports from core modules as this can trigger unnecessary getters.
const internal = this.id.startsWith('internal/');
- this.exportKeys = internal ? [] : Object.keys(this.exports);
+ this.exportKeys = internal ? [] : ObjectKeys(this.exports);
}
this.getESMFacade();
this.syncExports();
@@ -230,8 +232,8 @@ NativeModule.prototype.compileForPublicLoader = function() {
};
const getOwn = (target, property, receiver) => {
- return ObjectPrototype.hasOwnProperty(target, property) ?
- Reflect.get(target, property, receiver) :
+ return ObjectPrototypeHasOwnProperty(target, property) ?
+ ReflectGet(target, property, receiver) :
undefined;
};