lib: use null-prototype objects for property descriptors

PR-URL: https://github.com/nodejs/node/pull/43473
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Antoine du Hamel authored and Michaël Zasso committed 2022-07-31 09:45:01 +02:00
1 parent a97d0ba3af
commit aab5adbcbe
3 files changed
+7 -3

No files matched your search

+2
View File
@@ -132,11 +132,13 @@ addBufferPrototypeMethods(Buffer.prototype);
const constants = ObjectDefineProperties({}, {
MAX_LENGTH: {
__proto__: null,
value: kMaxLength,
writable: false,
enumerable: true
},
MAX_STRING_LENGTH: {
__proto__: null,
value: kStringMaxLength,
writable: false,
enumerable: true
+3 -3
View File
@@ -1181,9 +1181,9 @@ function createTeeReadableStream(start, pull, cancel) {
setupReadableStreamDefaultControllerFromSource(
this,
ObjectCreate(null, {
start: { value: start },
pull: { value: pull },
cancel: { value: cancel }
start: { __proto__: null, value: start },
pull: { __proto__: null, value: pull },
cancel: { __proto__: null, value: cancel }
}),
1,
() => 1);
+2
View File
@@ -49,11 +49,13 @@ const kType = Symbol('kType');
const AsyncIterator = ObjectCreate(AsyncIteratorPrototype, {
next: {
__proto__: null,
configurable: true,
enumerable: true,
writable: true,
},
return: {
__proto__: null,
configurable: true,
enumerable: true,
writable: true,