summaryrefslogtreecommitdiff
path: root/runtime/js/41_prompt.js
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2021-06-05 23:10:07 +0200
committerGitHub <noreply@github.com>2021-06-05 23:10:07 +0200
commitc73ef5fa143b473677d4cab069241ff018e0c971 (patch)
treef13f3ddb1741a81138240c36846e2a23fd562a02 /runtime/js/41_prompt.js
parentbb0c90cadbb99784681a2acac1fd65ac7f802297 (diff)
refactor(web): use encoding_rs for text encoding (#10844)
This commit removes all JS based text encoding / text decoding. Instead encoding now happens in Rust via encoding_rs (already in tree). This implementation retains stream support, but adds the last missing encodings. We are incredibly close to 100% WPT on text encoding now. This should reduce our baseline heap by quite a bit.
Diffstat (limited to 'runtime/js/41_prompt.js')
-rw-r--r--runtime/js/41_prompt.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/js/41_prompt.js b/runtime/js/41_prompt.js
index d74a937aa..cb088dafa 100644
--- a/runtime/js/41_prompt.js
+++ b/runtime/js/41_prompt.js
@@ -5,7 +5,6 @@
const { isatty } = window.__bootstrap.tty;
const LF = "\n".charCodeAt(0);
const CR = "\r".charCodeAt(0);
- const decoder = new TextDecoder();
const core = window.Deno.core;
function alert(message = "Alert") {
@@ -70,7 +69,7 @@
}
buf.push(c[0]);
}
- return decoder.decode(new Uint8Array(buf));
+ return core.decode(new Uint8Array(buf));
}
window.__bootstrap.prompt = {