diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-06-05 23:10:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-05 23:10:07 +0200 |
commit | c73ef5fa143b473677d4cab069241ff018e0c971 (patch) | |
tree | f13f3ddb1741a81138240c36846e2a23fd562a02 /core/error.rs | |
parent | bb0c90cadbb99784681a2acac1fd65ac7f802297 (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 'core/error.rs')
-rw-r--r-- | core/error.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/error.rs b/core/error.rs index 65e2e8da4..1d9df2641 100644 --- a/core/error.rs +++ b/core/error.rs @@ -36,6 +36,10 @@ pub fn type_error(message: impl Into<Cow<'static, str>>) -> AnyError { custom_error("TypeError", message) } +pub fn range_error(message: impl Into<Cow<'static, str>>) -> AnyError { + custom_error("RangeError", message) +} + pub fn invalid_hostname(hostname: &str) -> AnyError { type_error(format!("Invalid hostname: '{}'", hostname)) } |