mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
string_decoder: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36358 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
committed by
James M Snell
parent
7e5fc9c792
commit
4027e36dfd
@@ -25,6 +25,7 @@ const {
|
||||
ArrayBufferIsView,
|
||||
ObjectDefineProperties,
|
||||
Symbol,
|
||||
TypedArrayPrototypeSubarray,
|
||||
} = primordials;
|
||||
|
||||
const { Buffer } = require('buffer');
|
||||
@@ -104,8 +105,9 @@ ObjectDefineProperties(StringDecoder.prototype, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get() {
|
||||
return this[kNativeDecoder].subarray(kIncompleteCharactersStart,
|
||||
kIncompleteCharactersEnd);
|
||||
return TypedArrayPrototypeSubarray(this[kNativeDecoder],
|
||||
kIncompleteCharactersStart,
|
||||
kIncompleteCharactersEnd);
|
||||
}
|
||||
},
|
||||
lastNeed: {
|
||||
|
||||
Reference in New Issue
Block a user