mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: use null-prototype objects for property descriptors
Refs: https://github.com/nodejs/node/pull/42921 PR-URL: https://github.com/nodejs/node/pull/43270 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
parent
218664f638
commit
06d8606960
78 changed files with 444 additions and 83 deletions
|
@ -282,6 +282,7 @@ function Buffer(arg, encodingOrOffset, length) {
|
|||
}
|
||||
|
||||
ObjectDefineProperty(Buffer, SymbolSpecies, {
|
||||
__proto__: null,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
get() { return FastBuffer; }
|
||||
|
@ -756,6 +757,7 @@ Buffer.byteLength = byteLength;
|
|||
|
||||
// For backwards compatibility.
|
||||
ObjectDefineProperty(Buffer.prototype, 'parent', {
|
||||
__proto__: null,
|
||||
enumerable: true,
|
||||
get() {
|
||||
if (!(this instanceof Buffer))
|
||||
|
@ -764,6 +766,7 @@ ObjectDefineProperty(Buffer.prototype, 'parent', {
|
|||
}
|
||||
});
|
||||
ObjectDefineProperty(Buffer.prototype, 'offset', {
|
||||
__proto__: null,
|
||||
enumerable: true,
|
||||
get() {
|
||||
if (!(this instanceof Buffer))
|
||||
|
@ -1302,11 +1305,13 @@ module.exports = {
|
|||
|
||||
ObjectDefineProperties(module.exports, {
|
||||
constants: {
|
||||
__proto__: null,
|
||||
configurable: false,
|
||||
enumerable: true,
|
||||
value: constants
|
||||
},
|
||||
INSPECT_MAX_BYTES: {
|
||||
__proto__: null,
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get() { return INSPECT_MAX_BYTES; },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue