X Tutup
The Wayback Machine - https://web.archive.org/web/20221004230927/https://github.com/nodejs/node/commit/380659daf1
Skip to content
Permalink
Browse files
process: use defineProperty instead of assignment
PR-URL: #43907
Fixes: #43496
Refs: endojs/endo#576
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
  • Loading branch information
erights authored and danielleadams committed Jul 26, 2022
1 parent bbc455c commit 380659daf197ccbca0f9ea8ffaea4c1f969a4fee
Showing 1 changed file with 10 additions and 3 deletions.
@@ -15,6 +15,7 @@ const {
Float64Array,
NumberMAX_SAFE_INTEGER,
ObjectFreeze,
ObjectDefineProperty,
ReflectApply,
RegExpPrototypeExec,
SafeArrayIterator,
@@ -371,9 +372,15 @@ function buildAllowedFlags() {
return SetPrototypeValues(this[kInternal].set);
}
}
NodeEnvironmentFlagsSet.prototype.keys =
NodeEnvironmentFlagsSet.prototype[SymbolIterator] =
NodeEnvironmentFlagsSet.prototype.values;
const flagSetValues = NodeEnvironmentFlagsSet.prototype.values;
ObjectDefineProperty(NodeEnvironmentFlagsSet.prototype, SymbolIterator, {
__proto__: null,
value: flagSetValues,
});
ObjectDefineProperty(NodeEnvironmentFlagsSet.prototype, 'keys', {
__proto__: null,
value: flagSetValues,
});

ObjectFreeze(NodeEnvironmentFlagsSet.prototype.constructor);
ObjectFreeze(NodeEnvironmentFlagsSet.prototype);

0 comments on commit 380659d

Please sign in to comment.
X Tutup