Skip to content

Commit

Permalink
First prototype for new JsString using UTF-16 (#1659)
Browse files Browse the repository at this point in the history
I think it's time to address the elephant in the room.

This Pull Request will (hopefully!) solve part of #736.

This is a complete rewrite of `JsString`, but instead of storing `u8` bytes it stores `u16` words. The `encode!` macro (renamed to `utf16!` for simplicity) from the `const-utf16` crate allows us to create UTF-16 encoded arrays at compilation time. `JsString` implements `Deref<Target=[u16]>` to unlock the slice methods and possibly make some manipulations easier. However, we would need to create our own library of utilities for `JsString`.
  • Loading branch information
jedel1043 committed Oct 11, 2022
1 parent 07389cb commit df70302
Show file tree
Hide file tree
Showing 103 changed files with 4,660 additions and 3,458 deletions.
158 changes: 128 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"boa_unicode",
"boa_wasm",
"boa_examples",
"boa_macros",
]

[workspace.package]
Expand All @@ -26,6 +27,7 @@ boa_interner = { version = "0.16.0", path = "boa_interner" }
boa_gc = { version = "0.16.0", path = "boa_gc" }
boa_profiler = { version = "0.16.0", path = "boa_profiler" }
boa_unicode = { version = "0.16.0", path = "boa_unicode" }
boa_macros = { version = "0.16.0", path = "boa_macros" }

[workspace.metadata.workspaces]
allow_branch = "main"
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ boa_unicode.workspace = true
boa_interner.workspace = true
boa_gc.workspace = true
boa_profiler.workspace = true
boa_macros.workspace = true
gc = "0.4.1"
serde = { version = "1.0.145", features = ["derive", "rc"] }
serde_json = "1.0.85"
Expand All @@ -50,6 +51,8 @@ unicode-normalization = "0.1.22"
dyn-clone = "1.0.9"
once_cell = "1.15.0"
tap = "1.0.1"
sptr = "0.3.2"
static_assertions = "1.1.0"
icu_locale_canonicalizer = { version = "0.6.0", features = ["serde"], optional = true }
icu_locid = { version = "0.6.0", features = ["serde"], optional = true }
icu_datetime = { version = "0.6.0", features = ["serde"], optional = true }
Expand Down
Loading

0 comments on commit df70302

Please sign in to comment.