mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
lib: flatten access to primordials
Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. Backport-PR-URL: https://github.com/nodejs/node/pull/30731 PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
25b88acd0f
commit
e2ae4c1aa1
117 files changed
+1300
-932
No files matched your search
@@ -21,7 +21,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const { Object } = primordials;
|
||||
const {
|
||||
ObjectDefineProperties,
|
||||
} = primordials;
|
||||
|
||||
const { Buffer } = require('buffer');
|
||||
const {
|
||||
@@ -95,7 +97,7 @@ StringDecoder.prototype.text = function text(buf, offset) {
|
||||
return this.write(buf.slice(offset));
|
||||
};
|
||||
|
||||
Object.defineProperties(StringDecoder.prototype, {
|
||||
ObjectDefineProperties(StringDecoder.prototype, {
|
||||
lastChar: {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
|
||||
Reference in new issue
Block a user