mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05: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:
1 parent
ff546ff744
commit
0db9101922
1 file changed
+4
-2
@@ -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