Skip to content

Commit 33cb46d

Browse files
committed
update according to review
1 parent e559a44 commit 33cb46d

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

doc/api/process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2865,7 +2865,7 @@ added: v0.5.3
28652865
changes:
28662866
- version: REPLACEME
28672867
pr-url: https://github.com/nodejs/node/pull/61276
2868-
description: Make `moduleLoadList` immutable.
2868+
description: `moduleLoadList` is now a copy instead of the internal list itself.
28692869
-->
28702870
28712871
* Returns: {string\[]}

lib/internal/bootstrap/realm.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ const {
7575
const moduleLoadList = [];
7676
ObjectDefineProperty(process, 'moduleLoadList', {
7777
__proto__: null,
78-
get() { return ObjectFreeze(moduleLoadList.slice()); },
79-
configurable: false,
78+
get() { return ArrayPrototypeSlice(moduleLoadList); },
8079
enumerable: true,
8180
});
8281

test/parallel/test-process-moduleloadlist.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ require('../common');
44
const assert = require('assert');
55

66
assert.ok(Array.isArray(process.moduleLoadList));
7-
assert.throws(() => process.moduleLoadList.push('foo'), /^TypeError: Cannot add property \d+, object is not extensible$/);
87
assert.throws(() => process.moduleLoadList = 'foo', /^TypeError: Cannot set property moduleLoadList of #<process> which has only a getter$/);

0 commit comments

Comments
 (0)