Skip to content

Commit fb5968a

Browse files
committed
module: replace native methods with primordials
Replace native methods with primordials in helpers.js to protect against prototype pollution.
1 parent 05d6b9b commit fb5968a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/modules/helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ArrayPrototypeForEach,
5+
ArrayPrototypePush,
56
ObjectDefineProperty,
67
ObjectFreeze,
78
ObjectPrototypeHasOwnProperty,
@@ -85,7 +86,7 @@ function initializeCjsConditions() {
8586
...userConditions,
8687
];
8788
if (getOptionValue('--require-module')) {
88-
cjsConditionsArray.push('module-sync');
89+
ArrayPrototypePush(cjsConditionsArray, 'module-sync');
8990
}
9091
ObjectFreeze(cjsConditionsArray);
9192
cjsConditions = new SafeSet(cjsConditionsArray);

0 commit comments

Comments
 (0)