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 2022-06-27 17:29:10 +02:00 committed by GitHub
parent a055337a02
commit bb30e2da7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

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