Iban Eguia
4d2772d6a0
Rename "Boa" to boa_engine, moved GC and profiler to their crates ( #1844 )
...
* Separated GC and Profiler
* Fixed prettierignore
* Removed re-exports, fixed benchmarks, added some caches
* Removed empty line
* Update boa_engine/Cargo.toml
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
* Fixed the profiler
* Removed empty file
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
3 years ago
Iban Eguia
748465d17b
Unwrap removal ( #1842 )
...
This removes all the calls to `unwrap()` in the codebase, which made me found a couple of places where it wasn't needed, and could be improved. I also noticed we don't have dependabot updates for the test262 submodule and the interner dependencies, so I added those.
I added lints so that no new unwraps are added.
3 years ago
Iban Eguia
60b7eb8934
General code clean-up and new lint addition ( #1809 )
...
This PR adds some Clippy lints. Mainly, it adds the list of pedantic lints excluding some lints that were causing too many warnings. I also denied some useful restriction and pedantic lints, to make sure we use `Self` all the possible times (for better maintainability), and that we pass elements by reference where possible, for example, or that the documentation is properly written.
This might even have some small performance gains.
I also added a perfect hash function for the CLI keywords, which should be more efficient than a `HashSet`. This is something we could use elsewhere too.
3 years ago
Iban Eguia
e37cb6c9f6
Updated dependencies ( #1803 )
...
The main idea behind this is to upgrade the Unicode version from 13 to 14. I also upgraded the rest of the dependencies, so this closes #1802 , #1800 and #1799 .
3 years ago
Iban Eguia
e92cff5920
Interner support in the parser ( #1765 )
...
This builds on top of #1758 to try to bring #1763 to life.
Something that should probably be done here would be to convert `JsString` to a `Sym` internally. Then, further optimizations could be done adding common strings to a custom interner type (those that we know statically).
This is definitely work in progress, but I would like to have feedback on the API, and feel free to contribute.
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
3 years ago
Iban Eguia
48185f393d
Lexer string interning ( #1758 )
...
This Pull Request is part of #279 .
It adds a string interner to Boa, which allows many types to not contain heap-allocated strings, and just contain a `NonZeroUsize` instead. This can move types to the stack (hopefully I'll be able to move `Token`, for example, maybe some `Node` types too.
Note that the internet is for now only available in the lexer. Next steps (in this PR or future ones) would include also using interning in the parser, and finally in execution. The idea is that strings should be represented with a `Sym` until they are displayed.
Talking about display. I have changed the `ParseError` type in order to not contain anything that could contain a `Sym` (basically tokens), which might be a bit faster, but what is important is that we don't depend on the interner when displaying errors.
The issue I have now is in order to display tokens. This requires the interner if we want to know identifiers, for example. The issue here is that Rust doesn't allow using a `fmt::Formatter` (only in nightly), which is making my head hurt. Maybe someone of you can find a better way of doing this.
Then, about `cursor.expect()`, this is the only place where we don't have the expected token type as a static string, so it's failing to compile. We have the option of changing the type definition of `ParseError` to contain an owned string, but maybe we can avoid this by having a `&'static str` come from a `TokenKind` with the default values, such as "identifier" for an identifier. I wanted for you to think about it and maybe we can just add that and avoid allocations there.
Oh, and this depends on the VM-only branch, so that has to be merged before :)
Another thing to check: should the interner be in its own module?
3 years ago
dependabot[bot]
76a27ce2a5
Bump wasm-bindgen from 0.2.78 to 0.2.79 ( #1789 )
...
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) from 0.2.78 to 0.2.79.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md ">wasm-bindgen's changelog</a>.</em></p>
<blockquote>
<h2>0.2.79</h2>
<p>Released 2022-01-19.</p>
<p><a href="https://github.com/rustwasm/wasm-bindgen/compare/0.2.78...0.2.79 ">changes</a></p>
<hr />
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="9b0d40c7a9
"><code>9b0d40c</code></a> Version bump (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2772 ">#2772</a>)</li>
<li><a href="3e507e649c
"><code>3e507e6</code></a> Fix missing wasm_bindgen attribute (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2773 ">#2773</a>)</li>
<li><a href="3701c9d6be
"><code>3701c9d</code></a> Implement OptionIntoWasmAbi for Closure references (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2768 ">#2768</a>)</li>
<li><a href="c25c1f4b09
"><code>c25c1f4</code></a> Typo (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2765 ">#2765</a>)</li>
<li><a href="39423ed01a
"><code>39423ed</code></a> Fix some more tests</li>
<li><a href="d68ceed956
"><code>d68ceed</code></a> spellcheck (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2762 ">#2762</a>)</li>
<li><a href="f158a75e9e
"><code>f158a75</code></a> Update test expectations</li>
<li><a href="8aa58ac019
"><code>8aa58ac</code></a> Fix macro hygiene in wasm_bindgen_test (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2748 ">#2748</a>)</li>
<li><a href="c515cbf568
"><code>c515cbf</code></a> Documentation link updated. (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2749 ">#2749</a>)</li>
<li><a href="ac87c8215b
"><code>ac87c82</code></a> Fix <code>fn () -> Result\<T, JsValue></code> leaking stack space (<a href="https://github-redirect.dependabot.com/rustwasm/wasm-bindgen/issues/2710 ">#2710</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/rustwasm/wasm-bindgen/compare/0.2.78...0.2.79 ">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wasm-bindgen&package-manager=cargo&previous-version=0.2.78&new-version=0.2.79 )](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
3 years ago
dependabot[bot]
4bae3bbe99
Bump getrandom from 0.2.3 to 0.2.4 ( #1783 )
...
Bumps [getrandom](https://github.com/rust-random/getrandom ) from 0.2.3 to 0.2.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md ">getrandom's changelog</a>.</em></p>
<blockquote>
<h2>[0.2.4] - 2021-12-13</h2>
<h3>Changed</h3>
<ul>
<li>Use explicit imports in the <code>js</code> backend <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/220 ">#220</a></li>
<li>Use <code>/dev/urandom</code> on Redox instead of <code>rand:</code> <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/222 ">#222</a></li>
<li>Use <code>NonZeroU32::new_unchecked</code> to convert wasi error <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/233 ">#233</a></li>
</ul>
<h3>Added</h3>
<ul>
<li>SOLID targets (<code>*-kmc-solid_*</code>) support <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/235 ">#235</a></li>
<li>Limited Hermit (<code>x86_64-unknown-hermit</code>) support <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/236 ">#236</a></li>
</ul>
<p><a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/220 ">#220</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/220 ">rust-random/getrandom#220</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/222 ">#222</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/222 ">rust-random/getrandom#222</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/233 ">#233</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/233 ">rust-random/getrandom#233</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/235 ">#235</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/235 ">rust-random/getrandom#235</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/236 ">#236</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/236 ">rust-random/getrandom#236</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b9c7c0c13d
"><code>b9c7c0c</code></a> Release v0.2.4 (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/238 ">#238</a>)</li>
<li><a href="9110af54d1
"><code>9110af5</code></a> Fix get_rng_fd comment typo (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/240 ">#240</a>)</li>
<li><a href="ec445bb0ac
"><code>ec445bb</code></a> Added x86_64-unknown-hermit support (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/236 ">#236</a>)</li>
<li><a href="f5e33009ed
"><code>f5e3300</code></a> Add SOLID target support (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/235 ">#235</a>)</li>
<li><a href="0d0404be5a
"><code>0d0404b</code></a> Use <code>NonZeroU32::new_unchecked</code> to convert wasi error (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/233 ">#233</a>)</li>
<li><a href="e4004f41fa
"><code>e4004f4</code></a> redox: Switch to /dev/urandom (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/222 ">#222</a>)</li>
<li><a href="30308ae845
"><code>30308ae</code></a> js: Explictly list all dependancies used with the "js" feature (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/220 ">#220</a>)</li>
<li><a href="dcf452bb14
"><code>dcf452b</code></a> fix some typos (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/218 ">#218</a>)</li>
<li>See full diff in <a href="https://github.com/rust-random/getrandom/compare/v0.2.3...v0.2.4 ">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=getrandom&package-manager=cargo&previous-version=0.2.3&new-version=0.2.4 )](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
3 years ago
Jason Williams
dfb3df5bf2
Start removing non-VM path ( #1747 )
3 years ago
Halid Odat
3269c1b901
Generic `JsResult<R>` in `context.throw_` methods ( #1734 )
...
Previously when we had the `context.throw_` methods (like `context.thtrow_type_error()`) they were limited as to where we could call them, e.i. a function that returned `JsResult<JsValue>`. So we had to call the `context.construct_` methods with an explicit `Err()` enum wrap to throw in functions that returned non-jsvalues (which happens a lot).
Now, with this PR the throw methods have a generic `JsResult<R>` return that can return in any `JsResult<T>` returning function. Which cleans the API and makes the user experience a bit better.
```rust
return Err(context.construct_type_error("..."));
// to
return context.throw_type_error("...");
```
3 years ago
Iban Eguia
a5c85708a2
Clean-up contribution guidelines, dependencies, Test262, MSRV ( #1683 )
3 years ago
João Borges
8aeef422ed
Respect rust 1.56 ( #1681 )
...
* Style: Respect rust1.56
* Chore: Change to 2021 edition
3 years ago
Jason Williams
c977b8e5aa
changelog v0.13 ( #1590 )
...
Co-authored-by: Iban Eguia <iban.eguia@cern.ch>
3 years ago
dependabot[bot]
7195e7db02
Bump wasm-bindgen from 0.2.77 to 0.2.78 ( #1582 )
3 years ago
dependabot[bot]
ed01575a3e
Bump wasm-bindgen from 0.2.76 to 0.2.77 ( #1565 )
3 years ago
dependabot[bot]
d4e6f4eb02
Bump wasm-bindgen from 0.2.75 to 0.2.76 ( #1487 )
3 years ago
dependabot[bot]
e0ec7af88b
Bump wasm-bindgen from 0.2.74 to 0.2.75 ( #1454 )
...
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) from 0.2.74 to 0.2.75.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.74...0.2.75 )
---
updated-dependencies:
- dependency-name: wasm-bindgen
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
dependabot[bot]
6d36220f38
Bump getrandom from 0.2.2 to 0.2.3 ( #1267 )
4 years ago
dependabot[bot]
c0e1d4cfef
Bump wasm-bindgen from 0.2.73 to 0.2.74 ( #1247 )
...
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) from 0.2.73 to 0.2.74.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.73...0.2.74 )
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years ago
dependabot[bot]
f294dd294e
Bump wasm-bindgen from 0.2.72 to 0.2.73 ( #1195 )
4 years ago
dependabot[bot]
4d9374397a
Bump wasm-bindgen from 0.2.71 to 0.2.72 ( #1182 )
4 years ago
dependabot[bot]
4d0002ce29
Bump wasm-bindgen from 0.2.70 to 0.2.71 ( #1148 )
...
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) from 0.2.70 to 0.2.71.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.70...0.2.71 )
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years ago
dependabot[bot]
69d1f4a790
Bump wasm-bindgen from 0.2.69 to 0.2.70 ( #1098 )
4 years ago
dependabot[bot]
777c3659ae
Bump getrandom from 0.2.1 to 0.2.2 ( #1090 )
4 years ago
Jason Williams
9160b89edf
Changelog v0.11 ( #1052 )
...
v0.11
Co-authored-by: João Borges <rageknify@gmail.com>
Co-authored-by: Iban Eguia <iban.eguia@cern.ch>
4 years ago
Iban Eguia
624d03d2a2
Fixed a bunch of test262 panics ( #817 ) ( #1046 )
...
* Fixed a bunch of test262 panics (#817 )
This also implements a spec-compliant `parseInt()` function.
* Reverted a test
* Addressed long comments from review
4 years ago
dependabot[bot]
ceca316ca5
Bump getrandom from 0.2.0 to 0.2.1 ( #1037 )
4 years ago
Iban Eguia
9e9bf6531a
Upgraded dependencies, removed deprecated deps, updated the test262 submodule ( #1022 )
...
* Upgraded some dependencies, removed deprecated encoding deps, updated the test262 submodule
* Using previous syntax for yarn dependency
* Updated lockfile
4 years ago
dependabot[bot]
3fe98f8df8
Bump wasm-bindgen from 0.2.68 to 0.2.69 ( #949 )
4 years ago
Halid Odat
6eac058406
Code cleanup and inline ( #916 )
...
* use gc module
* Added #[inline]
* Change context valiable names to context
* Fix test262
* Update test262 submodule
* Fix: Switch interpreter for context
Co-authored-by: João Borges <rageknify@gmail.com>
4 years ago
Iban Eguia
be5d198b4d
CI workflow improvements (mostly Test262) ( #889 )
...
* Improved CI workflows
This improves several things in the CI workflows:
- More conformant Test262 result generation
- Benchmarks should now show comments for all users
- Added Test262 result comparison comments to Pull Requests
* Fixed typo
* Checking the comment generation
* Fixing conditions to test comments
* Fix a couple of bugs on the comparator
* Fixed format
* Trying to fix comment updating
* Removing commit autor when searching
* Replace the comment instead of appending
* Switched back to the `pull_request_target` event
4 years ago
Halid Odat
39b4ead8f7
Feature `console` crate feature ( #800 )
...
* Put console object in a feature flag
* Add documentation for crate features
* fix typo
4 years ago
Halid Odat
3e60d2c554
Change author to boa-dev ( #764 )
4 years ago
Jason Williams
2d8f7b7dbc
changelog for v0.10.0 ( #738 )
...
Changelog for v0.10.0
Co-authored-by: joshwd36 <joshwd36@users.noreply.github.com>
Co-authored-by: Halid Odat <halidodat@gmail.com>
4 years ago
dependabot[bot]
652aa3dc8b
Bump wasm-bindgen from 0.2.67 to 0.2.68 ( #692 )
...
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) from 0.2.67 to 0.2.68.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.67...0.2.68 )
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years ago
Halid Odat
edfafc4e03
Feature `Context` ( #656 )
...
- Move `Console` to `Context`
- Change `Context::global()` to `Context::global_object()`
- Remove some `use std::borrow::Borrow`
- Add some pub exports
- Add `Context::eval()`
- Deprecate forward_val, forward, exec
- Make boa_cli use Context::eval()
- Deprecated forward forward_val and exec
- Make deprecated functions
4 years ago
Iban Eguia
8fde98afa9
Add ECMAScript test suite (test262) ( #567 )
4 years ago
Paul Lancaster
cb93472b4a
New lexer ( #559 )
...
Co-authored-by: HalidOdat <halidodat@gmail.com>
Co-authored-by: Iban Eguia <razican@protonmail.ch>
Co-authored-by: Paul Lancaster <paul@lancasterzone.com>
Co-authored-by: neeldug <5161147+neeldug@users.noreply.github.com>
4 years ago
HalidOdat
c5b708b2ef
Moved value operations from `Interpreter` to `Value` ( #625 )
4 years ago
jasonwilliams
73f65f7800
0.9.0
4 years ago
Iban Eguia
477d408c10
Upgraded dependencies before the 0.9 release ( #537 )
4 years ago
Iban Eguia
64dbf13afd
Implemented #427 , #429 and #430 , and upgraded dependencies ( #472 )
4 years ago
Pedro Paulo
c8218dd91e
Replacement of dead links ( #423 )
...
* Update repository link on Cargo.toml
* Update repository for Cargo.toml [WASM]
* Update link on CONTRIBUTING.md
Moving <https://github.com/jasonwilliams/boa/issues > to <https://github.com/boa-dev/boa/issues >
* Remove dead links on CHANGELOG.md
Changes all dead links from <https://github.com/jasonwilliams/boa > to <https://github.com/boa-dev/boa >.
* Fix dead link on boa/Cargo.toml
From <https://github.com/jasonwilliams/boa > to <https://github.com/boa-dev/boa >
* CHANGELOG.md - Fix link on comparing v0.7.0 with v0.8.0
Previously comparing v0.7.0...HEAD
5 years ago
Iban Eguia
4beadfc9ad
Execution and Node modularization ( #392 )
5 years ago
Jason Williams
2149bdc67b
v0.8.0
5 years ago
Iban Eguia
fb47031f44
Changed HashMap and HashSet for Fx versions ( #368 )
5 years ago
Iban Eguia
e0e17a8f76
Removed the `serde-ast` feature and the `serde_json` export ( #353 )
5 years ago
Victor Tuekam
55c85768c3
create boa-wasm package ( #352 )
5 years ago