summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/node/polyfills/internal/buffer.mjs4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal/buffer.mjs b/ext/node/polyfills/internal/buffer.mjs
index 29c0a5584..6f3121233 100644
--- a/ext/node/polyfills/internal/buffer.mjs
+++ b/ext/node/polyfills/internal/buffer.mjs
@@ -35,6 +35,8 @@ import {
import { atob, btoa } from "ext:deno_web/05_base64.js";
import { Blob } from "ext:deno_web/09_file.js";
+const { core } = globalThis.__bootstrap;
+
export { atob, Blob, btoa };
const utf8Encoder = new TextEncoder();
@@ -2126,7 +2128,7 @@ export function readInt40BE(buf, offset = 0) {
}
export function byteLengthUtf8(str) {
- return utf8Encoder.encode(str).length;
+ return core.byteLength(str);
}
function base64ByteLength(str, bytes) {