Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Modified the loadfile example to show how Boa can read bytes #2363

Closed
wants to merge 1 commit into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Oct 21, 2022

Boa's Context::eval() and Context::parse() functions allow reading a byte slice directly, apart from a string. We were not showing this properly in our examples, so this modifies the loadfile.rs example to use a byte vector instead of a string, which allows us to use UTF-16 files, if I'm not mistaken.

@Razican Razican added enhancement New feature or request documentation update documentation labels Oct 21, 2022
@Razican Razican added this to the v0.17.0 milestone Oct 21, 2022
@github-actions
Copy link

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 93,383 93,383 0
Passed 69,095 69,095 0
Ignored 18,182 18,182 0
Failed 6,106 6,106 0
Panics 0 0 0
Conformance 73.99% 73.99% 0.00%

@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #2363 (4797cc9) into main (d51fee7) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2363   +/-   ##
=======================================
  Coverage   39.84%   39.84%           
=======================================
  Files         242      242           
  Lines       23242    23242           
=======================================
  Hits         9260     9260           
  Misses      13982    13982           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jedel1043
Copy link
Member

which allows us to use UTF-16 files, if I'm not mistaken.

Currently no, since the lexer and the parser assume UTF-8. Though, this will change when we make them generic over chars/u32 instead.

@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Oct 21, 2022
Boa's `Context::eval()` and `Context::parse()` functions allow reading a byte slice directly, apart from a string. We were not showing this properly in our examples, so this modifies the `loadfile.rs` example to use a byte vector instead of a string, which allows us to use UTF-16 files, if I'm not mistaken.
@bors
Copy link

bors bot commented Oct 21, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Modified the loadfile example to show how Boa can read bytes [Merged by Bors] - Modified the loadfile example to show how Boa can read bytes Oct 21, 2022
@bors bors bot closed this Oct 21, 2022
@bors bors bot deleted the better_loadfile_example branch October 21, 2022 16:24
@Razican Razican added the hacktoberfest-accepted PR accepted for Hacktoberfest label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation update documentation enhancement New feature or request hacktoberfest-accepted PR accepted for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants