Skip to content

Commit

Permalink
lib: use null-prototype objects for property descriptors
Browse files Browse the repository at this point in the history
PR-URL: #43473
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
aduh95 authored and targos committed Jul 12, 2022
1 parent b9198d9 commit 2233567
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions lib/internal/webstreams/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2233567

Please sign in to comment.