Skip to content

Commit

Permalink
Fix string.prototype methods and add static string methods (#1123)
Browse files Browse the repository at this point in the history
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->

This Pull Request fixes existing string prototype methods in #13 and adds static methods.

It changes the following:

- Fix bugs in existing string prototype methods and improve readability (e.g. rename variables to match the names in spec)
- Add static methods `String.raw`, `String.fromCharCode`, `String.fromCodePoint`
- Fix broken unit tests


Co-authored-by: RageKnify <RageKnify@gmail.com>
  • Loading branch information
jevancc and RageKnify committed Feb 15, 2022
1 parent 7e77276 commit be26b10
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 287 deletions.
2 changes: 1 addition & 1 deletion boa/src/builtins/regexp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ fn advance_string_index(s: &JsString, index: usize, unicode: bool) -> usize {

// 5. Let cp be ! CodePointAt(S, index).
let (_, offset, _) =
crate::builtins::string::code_point_at(s, index as i32).expect("Failed to get code point");
crate::builtins::string::code_point_at(s, index as i64).expect("Failed to get code point");

index + offset as usize
}
Loading

0 comments on commit be26b10

Please sign in to comment.