Skip to content

Commit 2233567

Browse files
aduh95targos
authored andcommitted
lib: use null-prototype objects for property descriptors
PR-URL: #43473 Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent b9198d9 commit 2233567

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/buffer.js

+2
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,13 @@ addBufferPrototypeMethods(Buffer.prototype);
132132

133133
const constants = ObjectDefineProperties({}, {
134134
MAX_LENGTH: {
135+
__proto__: null,
135136
value: kMaxLength,
136137
writable: false,
137138
enumerable: true
138139
},
139140
MAX_STRING_LENGTH: {
141+
__proto__: null,
140142
value: kStringMaxLength,
141143
writable: false,
142144
enumerable: true

lib/internal/webstreams/readablestream.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1181,9 +1181,9 @@ function createTeeReadableStream(start, pull, cancel) {
11811181
setupReadableStreamDefaultControllerFromSource(
11821182
this,
11831183
ObjectCreate(null, {
1184-
start: { value: start },
1185-
pull: { value: pull },
1186-
cancel: { value: cancel }
1184+
start: { __proto__: null, value: start },
1185+
pull: { __proto__: null, value: pull },
1186+
cancel: { __proto__: null, value: cancel }
11871187
}),
11881188
1,
11891189
() => 1);

lib/internal/webstreams/util.js

+2
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ const kType = Symbol('kType');
4949

5050
const AsyncIterator = ObjectCreate(AsyncIteratorPrototype, {
5151
next: {
52+
__proto__: null,
5253
configurable: true,
5354
enumerable: true,
5455
writable: true,
5556
},
5657
return: {
58+
__proto__: null,
5759
configurable: true,
5860
enumerable: true,
5961
writable: true,

0 commit comments

Comments
 (0)