mirror of https://github.com/boa-dev/boa.git
Tree:
333b94a9ec
add-vhs-ci
benchmarks
control-flow-graph
expect-lints
feature/node_span
feature/snapshot
features
gh-readonly-queue/main/pr-2877-b0ddf5eed00a53281d67fc7d846233fc0d99ce9c
gh-readonly-queue/main/pr-3144-8e48cec73fae708420b9af88813d4870243c491a
main
nan-boxing
optimization/static-shapes
real_conformance
reduce-environment-allocations
refactor/interner
refactor/register-vm
release-0.20
releases/0.17
releases/0.19
semver_checks
tco
utility-crate
wasm-debugger
nightly
v0.10
v0.11
v0.12
v0.13
v0.14
v0.15
v0.16
v0.17
v0.17.1
v0.17.2
v0.17.3
v0.18
v0.19
v0.19.1
v0.2.0
v0.2.1
v0.3.0
v0.4.0
v0.5.0
v0.5.1
v0.6.0
v0.7.0
v0.8.0
v0.9.0
${ noResults }
366 Commits (333b94a9ecd7c7eea3d086f754b91b5ee1a1a380)
Author | SHA1 | Message | Date |
---|---|---|---|
dependabot[bot] | a8a49ebca7 |
Bump chrono from 0.4.23 to 0.4.24 (#2653)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.23 to 0.4.24. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/releases">chrono's releases</a>.</em></p> <blockquote> <h2>0.4.24</h2> <p>This is a small maintenance release with accumulated fixes and improvements.</p> <ul> <li>Fix doc on <code>Days::new()</code> to refer to days, not months (<a href="https://redirect.github.com/chronotope/chrono/issues/874">#874</a>, thanks to <a href="https://github.com/brotskydotcom"><code>@brotskydotcom</code></a>)</li> <li>Clarify out of range value for <code>from_timestamp_opt()</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/879">#879</a>, thanks to <a href="https://github.com/xmo-odoo"><code>@xmo-odoo</code></a>)</li> <li>Add <code>format_localized()</code> for <code>NaiveDate</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/881">#881</a>, thanks to <a href="https://github.com/mseele"><code>@mseele</code></a>)</li> <li>Fix bug in <code>Add</code>/<code>Sub</code> <code>Days</code>, add tests with DST timezone (<a href="https://redirect.github.com/chronotope/chrono/issues/878">#878</a>)</li> <li>Make <code>NaiveTime::MIN</code> public (<a href="https://redirect.github.com/chronotope/chrono/issues/890">#890</a>)</li> <li>Fix <code>from_timestamp_millis()</code> implementation and add more tests (<a href="https://redirect.github.com/chronotope/chrono/issues/885">#885</a>)</li> <li>Fix typo in docstrings (<a href="https://redirect.github.com/chronotope/chrono/issues/897">#897</a>, thanks to <a href="https://github.com/dandxy89"><code>@dandxy89</code></a>)</li> <li>Add test proving that <a href="https://redirect.github.com/chronotope/chrono/issues/903">#903</a> is fixed in 0.4.x head (<a href="https://redirect.github.com/chronotope/chrono/issues/905">#905</a>, thanks to <a href="https://github.com/umanwizard"><code>@umanwizard</code></a>)</li> <li>Add <code>from_timestamp_micros()</code> function (<a href="https://redirect.github.com/chronotope/chrono/issues/906">#906</a>, thanks to <a href="https://github.com/umanwizard"><code>@umanwizard</code></a>)</li> <li>Check cargo-deny in CI (<a href="https://redirect.github.com/chronotope/chrono/issues/909">#909</a>)</li> <li>Derive <code>Hash</code> for most pub types that also derive <code>PartialEq</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/938">#938</a>, thanks to <a href="https://github.com/bruceg"><code>@bruceg</code></a>)</li> <li>Update deprecated methods in <code>from_utc()</code> example (<a href="https://redirect.github.com/chronotope/chrono/issues/939">#939</a>, thanks to <a href="https://github.com/greg-el"><code>@greg-el</code></a>)</li> <li>Fix panic in <code>DateTime::checked_add_days()</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/942">#942</a>, thanks to <a href="https://github.com/Ekleog"><code>@Ekleog</code></a>)</li> <li>More documentation for dates before 1 BCE or after 9999 CE (<a href="https://redirect.github.com/chronotope/chrono/issues/950">#950</a>, thanks to <a href="https://github.com/cgit"><code>@cgit</code></a>)</li> <li>Improve <code>FixedOffset</code> docs (<a href="https://redirect.github.com/chronotope/chrono/issues/953">#953</a>, thanks to <a href="https://github.com/klnusbaum"><code>@klnusbaum</code></a>)</li> <li>Add chrono-fuzz to CI and update its libfuzzer-sys dependency (<a href="https://redirect.github.com/chronotope/chrono/issues/968">#968</a>, thanks to <a href="https://github.com/LingMan"><code>@LingMan</code></a>)</li> <li>Fixes to parsing and calculation of week numbers (<a href="https://redirect.github.com/chronotope/chrono/issues/966">#966</a>, thanks to <a href="https://github.com/raphaelroosz"><code>@raphaelroosz</code></a>)</li> <li>Make iana-time-zone a target specific dependency (<a href="https://redirect.github.com/chronotope/chrono/issues/980">#980</a>, thanks to <a href="https://github.com/krtab"><code>@krtab</code></a>)</li> <li>Make eligible functions <code>const</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/984">#984</a>, thanks to <a href="https://github.com/tormeh"><code>@tormeh</code></a>)</li> </ul> <p>Thanks to all contributors from the chrono team, <a href="https://github.com/esheppa"><code>@esheppa</code></a> and <a href="https://github.com/djc"><code>@djc</code></a>.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ced0024fc5 |
Bump regress from 0.4.1 to 0.5.0 (#2651)
Bumps [regress](https://github.com/ridiculousfish/regress) from 0.4.1 to 0.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/ridiculousfish/regress/releases">regress's releases</a>.</em></p> <blockquote> <h2>v0.5.0</h2> <p>Version 0.5.0 of regress, REGex in Rust with EmcaScript Syntax.</p> <ul> <li>Unicode property escape matching like <code>\p{Letter}</code> is implemented</li> <li>Regex parsing may now use any u32 iterator, not simply strings</li> <li>The Unicode flag "u" is now recognized. Unicode is no longer the default; however non-Unicode regular expression support still has some known differences from JavaScript.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 3d3191654d |
Bump serde from 1.0.153 to 1.0.154 (#2645)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.153 to 1.0.154. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.154</h2> <ul> <li>Fix "undeclared lifetime" error in generated code when deriving Deserialize for an enum with both <code>flatten</code> and <code>'static</code> fields (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2383">#2383</a>, thanks <a href="https://github.com/Mingun"><code>@Mingun</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Kevin | 9da07dce72 |
Rust 1.68 clippy fixes (#2646)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request addresses the broken `cargo clippy` lints that is currently causing CI to fail. |
2 years ago |
dependabot[bot] | 718fea378a |
Bump serde from 1.0.152 to 1.0.153 (#2640)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.152 to 1.0.153. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.153</h2> <ul> <li>Support <code>serde(alias = "…")</code> attribute used inside of flattened struct (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2387">#2387</a>, thanks <a href="https://github.com/bebecue"><code>@bebecue</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ee9f4d97ab |
Bump sys-locale from 0.2.3 to 0.2.4 (#2641)
Bumps [sys-locale](https://github.com/1Password/sys-locale) from 0.2.3 to 0.2.4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/1Password/sys-locale/releases">sys-locale's releases</a>.</em></p> <blockquote> <h2>v0.2.4</h2> <p>See <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md#024---2023-03-07">the changelog</a> for details.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md">sys-locale's changelog</a>.</em></p> <blockquote> <h1>[0.2.4] - 2023-03-07</h1> <h3>Changed</h3> <ul> <li>Removed dependency on the <code>winapi</code> crate in favor of <code>windows-sys</code>, following more of the wider ecosystem.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | b87930349d |
Bump serde_json from 1.0.93 to 1.0.94 (#2637)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.93 to 1.0.94. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>v1.0.94</h2> <ul> <li>Fix message duplication between serde_json::Error's <code>Display</code> and <code>source()</code> (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/991">#991</a>, <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/992">#992</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 75b86477e5 |
Bump thiserror from 1.0.38 to 1.0.39 (#2636)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.38 to 1.0.39. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/thiserror/releases">thiserror's releases</a>.</em></p> <blockquote> <h2>1.0.39</h2> <ul> <li>Set html_root_url attribute</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 7e8c1bc70a |
Bump indoc from 2.0.0 to 2.0.1 (#2634)
Bumps [indoc](https://github.com/dtolnay/indoc) from 2.0.0 to 2.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/indoc/releases">indoc's releases</a>.</em></p> <blockquote> <h2>2.0.1</h2> <ul> <li>Set html_root_url attribute</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | d94e40aa01 |
Migrate tests to new test API (#2619)
This PR migrates our entire test suite to our new testing API. It changes the following: - Migrates tests to new test API. - Cleans up the API to be a bit more descriptive and maintainable. - Prettifies our test failure display to show the failed scripts. - Splits our massive `tests.rs` file into smaller sub-suites. Example output of a failing test: ![image](https://user-images.githubusercontent.com/38230983/221502567-9e219371-b4ab-49d0-b42b-94a9b1a9c002.png) |
2 years ago |
hanabi1224 | c15bf73b65 |
fix: RUSTSEC-2020-0071 in boa_engine (#2627)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request fixes/closes https://github.com/boa-dev/boa/issues/1671 It changes the following: - This PR tries to fix https://rustsec.org/advisories/RUSTSEC-2020-0071 in `boa_engine` crate by removing `time 0.1` from the dependency tree `cargo tree -p boa_engine | grep time` before: ```console │ ├── iana-time-zone v0.1.53 │ └── time v0.1.45 │ │ └── toml_datetime v0.5.1 ``` after: ```console │ ├── iana-time-zone v0.1.53 │ │ └── toml_datetime v0.5.1 ``` |
2 years ago |
dependabot[bot] | 92f1088ddc |
Bump num_enum from 0.5.10 to 0.5.11 (#2617)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.10 to 0.5.11. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Choongwoo Han | 3d6931cf9c |
Keep Integer type for inc/dec of an integer (#2615)
Keep Integer type after running unary increment/decrement ops if possible. The integer type will be useful to take fast paths for accessing index properties. (e.g., `let a = 1; arr[++a]`) |
2 years ago |
José Julián Espina | 280199b07a |
API to construct a `NativeFunction` from a native async function (#2542)
~~Builds off of #2529.~~ Merged. This Pull Request allows passing any function returning `impl Future<Output = JsResult<JsValue>>` to the `NativeFunction` constructor, allowing native concurrency hooks into the engine. It changes the following: - Adds a `NativeFunction::from_async_fn` function. - Adds a new `JobQueue::enqueue_future_job` method. - Adds an example usage on `boa_examples`. |
2 years ago |
dependabot[bot] | fa2c3c1e99 |
Bump num_enum from 0.5.9 to 0.5.10 (#2613)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.9 to 0.5.10. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Choongwoo Han | f8b682085d |
Optimize Get/SetPropertyByName (#2608)
Similar to #2604, `GetPropertyByName`/`SetPropertyByName` has only string property key. So, we can skip index and utf16 conversions. This improves QuickJS benchmark score 5.8% on average. Richards: 37.0 -> 41.2 DeltaBlue: 38.1 -> 41.4 Crypto: 59.6 -> 59.8 RayTrace: 146 -> 159 EarleyBoyer: 138 -> 142 Splay: 104 -> 106 NavierStokes: 10.2 -> 10.3 |
2 years ago |
raskad | f457ea95f8 |
Fix string to number conversion for `infinity` (#2607)
This Pull Request changes the following: - Fix string to number conversion for all invalid variants of `infinity` |
2 years ago |
raskad | 310c67195a |
Remove Syntax Errors from Bytecompiler (#2598)
This Pull Request closes #1907. It changes the following: - Implement several early errors relating to labels, `break` and `continue` in the parser. - Implement an early error for invalid cover grammar of object literals in the parser. - Remove all remaining syntax errors from the bytecompiler. |
2 years ago |
José Julián Espina | 60c25b45e7 |
Fix doc tests and add CI check (#2606)
This Pull Request fixes #2605. It changes the following: - Adds a CI check to run `cargo test --doc` since `nextest` doesn't support doc tests at the moment. - Fixes the failing doc tests. |
2 years ago |
Choongwoo Han | 4750e8d53a |
Fast path for static property keys (#2604)
When a rust string literal is given for a property key, boa checks if it can be parsed as an index and converts the string into a utf16 slice. This PR rewrites each hard-coded property key as a utf16 slice so that we can bypass those conversions at runtime. This improves QuickJS benchmark score 5% on average. Richards: 35.4 -> 37.0 DeltaBlue: 35.0 -> 38.1 Crypto: 57.6 -> 59.6 RayTrace: 137 -> 146 EarleyBoyer: 131 -> 138 Splay: 98.3 -> 104 NavierStokes: 10.2 -> 10.2 |
2 years ago |
raskad | f538cb214c |
Implement `WeakMap` (#2597)
This Pull Request changes the following: - Implement `WeakMap` buildin object. |
2 years ago |
dependabot[bot] | 4ca067a16c |
Bump once_cell from 1.17.0 to 1.17.1 (#2602)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.0 to 1.17.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's changelog</a>.</em></p> <blockquote> <h2>1.17.1</h2> <ul> <li>Make <code>OnceRef</code> implementation compliant with <a href="https://github-redirect.dependabot.com/rust-lang/rust/issues/95228">strict provenance</a>.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | ffa854ce3f |
Implement `WeakSet` (#2586)
This Pull Request changes the following: - Implement `WeakSet` buildin object. - Supersedes #2009 Co-authored-by: raskad <32105367+raskad@users.noreply.github.com> |
2 years ago |
dependabot[bot] | 0ca8ce23b7 |
Bump serde_json from 1.0.92 to 1.0.93 (#2594)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.92 to 1.0.93. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>v1.0.93</h2> <ul> <li>Support 128-bit integers in serde_json::to_value (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/982">#982</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 10adeeb49e |
Bump serde_json from 1.0.91 to 1.0.92 (#2588)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.91 to 1.0.92. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>v1.0.92</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Kevin | c2809ef6f1 |
Try-catch-block control flow fix/refactor (#2568)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request is meant to address #1900. While working on it, there was a decent amount of refactoring/restructuring. Initially, I had kept with the current approach of just keeping track of a kind and counter on the environment stack, especially because that kept the size of each stack entry to a minimum. I did, however, make a switch to having the opcode create the `EnvStackEntry` with a start address and exit address for a bit more precision. It changes the following: - Consolidates `loop_env_stack` and `try_env_stack` into one `EnvStackEntry` struct. - Changes `Continue`, `Break`, `LoopStart`, `LoopContinue`, `FinallyStart`, `FinallyEnd` and various others. Most of this primarily revolves around the creating of `EnvStackEntry` and interacting with the `env_stack`. - Changes/updates the try-catch-finally, break and continue statement compilations as necessary - Adds an `AbruptCompletionRecord` in place of the `finally_jump` vector. - Adds some tests for try-catch-finally blocks with breaks. |
2 years ago |
Iban Eguia Moraza | 3f9f6f0fce |
Module parsing (#2411)
I'm creating this draft PR, since I wanted to have some early feedback, and because I though I would have time to finish it last week, but I got caught up with other stuff. Feel free to contribute :) The main thing here is that I have divided `eval()`, `parse()` and similar functions so that they can decide if they are parsing scripts or modules. Let me know your thoughts. Then, I was checking the import & export parsing, and I noticed we are using `TokenKind::Identifier` for `IdentifierName`, so I changed that name. An `Identifier` is an `IdentifierName` that isn't a `ReservedWord`. This means we should probably also adapt all `IdentifierReference`, `BindingIdentifier` and so on parsing. I already created an `Identifier` parser. Something interesting there is that `await` is not a valid `Identifier` if the goal symbol is `Module`, as you can see in the [spec](https://tc39.es/ecma262/#prod-LabelIdentifier), but currently we don't have that information in the `InputElement` enumeration, we only have `Div`, `RegExp` and `TemplateTail`. How could we approach this? Co-authored-by: jedel1043 <jedel0124@gmail.com> |
2 years ago |
Mrmaxmeier | 4aebe39e15 |
fuzzer: bubble up NoInstructionsRemain error instead of trying to handle as exception (#2566)
Hi, the `vm-implied` fuzzer panics when executing this testcase: ```javascript try { new function() { while (this) {} }(); } catch { } ``` `internal error: entered unreachable code: The NoInstructionsRemain native error cannot be converted to an opaque type` Handling the `NoInstructionsRemain` error upfront instead of going through the VM exception handling logic seems to work. |
2 years ago |
Kevin | 9d521f9acf |
Feature flag on builtins console import (#2584)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> Adding a feature flag to the console import in `builtins`. I think this should fix the failing action on the `Upload docs and run benchmarks` step |
2 years ago |
raskad | 3725ff85f7 |
Implement binary `in` operation with private names (#2582)
This Pull Request changes the following: - Implement binary `in` operation with private names. - Adding a separate `BinaryInPrivate` expression in addition to the existing `Binary` expression seems like the best way to implement this in a typesafe manner. Other methods like adding an enum for the `Binary` lhs result in having to make assertions. |
2 years ago |
José Julián Espina | c03928309a |
Cleanup intrinsics and move to realm (#2555)
Small (ish?) step towards having proper realm records This PR changes the following: - Moves `Intrinsics` to `Realm`. - Cleans up the initialization logic of our intrinsics to not depend on `Context`, unblocking things like #2314. - Adds hooks to initialize the global object and the global this per the corresponding [`InitializeHostDefinedRealm ( )`](https://tc39.es/ecma262/#sec-initializehostdefinedrealm) hook. Though, this is currently broken because the vm uses `GlobalPropertyMap` instead of the `JsObject` API to initialize global properties. |
2 years ago |
raskad | b76050df44 |
Move increment and decrement operations to `Update` expression (#2565)
This Pull Request changes the following: - Move postfix/prefix increment and decrement operations from the `Unary` expression to a new `Update` expression. - Add a special type for the `Update` expression target as it is very limited in comparision to an `Unary` target. - This makes bytecode compilation more typesafe for these operations and removes syntax errors from the bytecompiler without introducing panics (see #1907). |
2 years ago |
José Julián Espina | ddf00c8c03 |
Improve identifier parsing (#2581)
Another change extracted from #2411. This PR changes the following: - Improves our identifier parsing with a new `Identifier` parser that unifies parsing for `IdentifierReference`, `BindingIdentifier` and `LabelIdentifier`. - Slightly improves some error messages. - Extracts our manual initialization of static `Sym`s with a new `static_syms` proc macro. - Adds `set_module_mode` and `module_mode` to the cursor to prepare for modules. |
2 years ago |
José Julián Espina | 515d28f0a2 |
Create `Source` to abstract JS code sources (#2579)
Slightly related to #2411 since we need an API to pass module files, but more useful for #1760, #1313 and other error reporting issues. It changes the following: - Introduces a new `Source` API to store the path of a provided file or `None` if the source is a plain string. - Improves the display of `boa_tester` to show the path of the tests being run. This also enables hyperlinks to directly jump to the tested file from the VS terminal. - Adjusts the repo to this change. Hopefully, this will improve our error display in the future. |
2 years ago |
raskad | aa8e0c55dd |
Update icu dependencies (#2574)
This Pull Request changes the following: - Update icu dependencies - Regenerate icu data |
2 years ago |
raskad | e6a1c3789d |
Fix rust 1.67 lints (#2567)
This Pull Request changes the following: - Fix rust 1.67 lints |
2 years ago |
dependabot[bot] | 753cab6a3b |
Bump num_enum from 0.5.7 to 0.5.9 (#2564)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.7 to 0.5.9. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/illicitonion/num_enum/commits/0.5.9">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=num_enum&package-manager=cargo&previous-version=0.5.7&new-version=0.5.9)](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> |
2 years ago |
José Julián Espina | 097f85e409 |
First batch of `no_std` support for some sub-crates (#2544)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request enables support for `no_std` targets on some of our sub-crates. I intentionally left out `boa_ast` and `boa_cli` because they're the largest crates we have after `boa_engine`. `boa_gc` is a monster on its own, because we'll need to design a `no_std` multithreaded GC. Anyways, this changes the following: - Adds support for `no_std` on `boa_unicode`. - Adds support for `no_std` on `boa_profiler`. - Adds support for `no_std` on `boa_interner`. - Adds support for `no_std` on `boa_icu_provider`. |
2 years ago |
raskad | 787d4a8bc5 |
Fix double property access on assignment ops (#2551)
Currently the compilation of assignment operators leads to a double object property access, both on the get and set access. While this refactor adds special access handling instead of using the existing `access_set` and `access_get` functions, it fixes the double access and should also make the resulting code more efficient. |
2 years ago |
raskad | 6c8e9c7070 |
Avoid creating `prototype` property on methods (#2553)
This Pull Request changes the following: - Stop creating a `prototype` property on class methods by passing a flag to the relevant opcodes. |
2 years ago |
raskad | 9355c77e0b |
Fix error for static class methods named `prototype` (#2552)
This Pull Request changes the following: - Remove wrong early errors for static class methods with the computed property name `prototype`. - Switch static class method definition opcodes from `__define_own_property__` to `define_property_or_throw` to correctly throw runtime errors on property redefinitions. |
2 years ago |
raskad | 96a6e0a346 |
Return the correct value from a statement list (#2554)
When compiling a statement list we need to make sure that the last expression that returns a value is compiled with the `use_expr` flag. Currently we set `use_expr` on the last statement of the statement list. This leads to incorrect returns when the last statement does not return a value. This PR fixes this by looking up the last value returning expression in a statement list and setting the `use_expr` appropriately. |
2 years ago |
José Julián Espina | 7c9eef8edc |
Improve the design of ephemerons in our GC (#2530)
This PR changes the following: - Modifies `EphemeronBox` to be more akin to `GcBox`, with its own header, roots and markers. This also makes it more similar to [Racket's](https://docs.racket-lang.org/reference/ephemerons.html) implementation. - Removes `EPHEMERON_QUEUE`. - Ephemerons are now tracked on a special `weak_start` linked list, instead of `strong_start` which is where all other GC boxes live. - Documents all unsafe blocks. - Documents our current garbage collection algorithm. I hope this'll clarify a bit what exactly are we doing on every garbage collection. - Renames/removes some functions. |
2 years ago |
Kevin | 90d310b184 |
Labelled ByteCompiler Fix (#2534)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request addresses #2295, and another case that I came across when I was adding `Break` to the `ByteCompiler` I did have a question that came up during this regarding the spec. We currently don't implement the [BreakableStatement](https://tc39.es/ecma262/#prod-BreakableStatement). Any thoughts on whether we should be? Especially since `BreakableStatement` seems to be a bit of a inaccurate since `LabelledStatement` is breakable too. It changes the following: - Moves handling of label jump out of `compile_block` and into `compile_labelled`. - Adds a couple more tests to keep track of `LabelledStatement` breaks. Co-authored-by: Ness <Kevin.Ness@Staples.com> |
2 years ago |
José Julián Espina | 5ab0aa21cc |
Implement host hooks and job queues APIs (#2529)
Follows from #2528, and should complement #2411 to implement the module import hooks. ~~Similarly to the Intl/ICU4X PR (#2478), this has a lot of trivial changes caused by the new lifetimes. I thought about passing the queue and the hooks by value, but it was very painful having to wrap everything with `Rc` in order to be accessible by the host. In contrast, `&dyn` can be easily provided by the host and has the advantage of not requiring additional allocations, with the downside of adding two more lifetimes to our `Context`, but I think it's worth.~~ I was able to unify all lifetimes into the shortest one of the three, making our API just like before! Changes: - Added a new `HostHooks` trait and a `&dyn HostHooks` field to `Context`. This allows hosts to implement the trait for their custom type, then pass it to the context. - Added a new `JobQueue` trait and a `&dyn JobQueue` field to our `Context`, allowing custom event loops and other fun things. - Added two simple implementations of `JobQueue`: `IdleJobQueue` which does nothing and `SimpleJobQueue` which runs all jobs until all successfully complete or until any of them throws an error. - Modified `boa_cli` to run all jobs until the queue is empty, even if a job returns `Err`. This also prints all errors to the user. |
2 years ago |
José Julián Espina | 08e5e46117 |
Make `JsSymbol` thread-safe (#2539)
The section about `Symbol` on the [specification](https://tc39.es/ecma262/#sec-ecmascript-language-types-symbol-type) says: > The Symbol type is the set of all non-String values that may be used as the key of an Object property ([6.1.7](https://tc39.es/ecma262/#sec-object-type)). Each possible Symbol value is unique and immutable. Our previous implementation of `JsSymbol` used `Rc` and a thread local `Cell<usize>`. However, this meant that two different symbols in two different threads could share the same hash, making symbols not unique. Also, the [GlobalSymbolRegistry](https://tc39.es/ecma262/#table-globalsymbolregistry-record-fields) is meant to be shared by all realms, including realms that are not in the same thread as the main one; this forces us to replace our current thread local global symbol registry with a thread-safe one that uses `DashMap` for concurrent access. However, the global symbol registry uses `JsString`s as keys and values, which forces us to either use `Vec<u16>` instead (wasteful and needs to allocate to convert to `JsString` on each access) or make `JsString` thread-safe with an atomic counter. For this reason, I implemented the second option. This PR changes the following: - Makes `JsSymbol` thread-safe by using Arc instead of Rc, and making `SYMBOL_HASH_COUNT` an `AtomicU64`. - ~~Makes `JsString` thread-safe by using `AtomicUsize` instead of `Cell<usize>` for its ref count.~~ EDIT: Talked with @jasonwilliams and we decided to use `Box<[u16]>` for the global registry instead, because this won't penalize common usage of `JsString`, which is used a LOT more than `JsSymbol`. - Makes the `GLOBAL_SYMBOL_REGISTRY` truly global, using `DashMap` as our global map that is shared by all threads. - Replaces some thread locals with thread-safe alternatives, such as static arrays and static indices. - Various improvements to all related code for this. |
2 years ago |
raskad | 1269381ac8 |
Correctly parse consecutive semicolons (#2533)
This Pull Request changes the following: - Do not skip consecutive semicolons while parsing a `StatementList`. - Expect semicolon in `LexicalDeclaration` and add an special case for `for` loop parsing. - Adjust `StatementList` compilation to skip empty statements. - Adjust/add tests to make sure consecutive semicolons are correctly parsed. |
2 years ago |
Kevin | ff06690140 |
Clarity changes for the VM (#2531)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> Some small changes to the VM with the hopes of making it a bit more clear and concise. It changes the following: - Changes `code` to `code_block` and `code` to `bytecode` in `CallFrame` and `CodeBlock`, respectively. - Adds some creation methods to `CallFrame`. - Implements `Default` for `Vm`. |
2 years ago |
raskad | 3dca430588 |
Refactor some class features (#2513)
This Pull Request fixes various bugs related to classes. The biggest changes are: - Changed private names to be unique across multiple classes. - Changed private name resolution to work via a visitor after a class is parsed. The way class early errors are defined makes it impossible to perform private name resolution while parsing. - Added function names to class methods. - Added class name binding to method function environments. - Separated opcodes for `static` and non-`static` class method definitions to make the above operations possible. There are still some bugs and further issues with classes but this is already a lot. |
2 years ago |
José Julián Espina | 1bef214a35 |
Prepare `Promises` for new host hooks and job queue API (#2528)
As part of the new modules PR, I was working on implementing the [host hooks](https://tc39.es/ecma262/#sec-host-hooks-summary) for the module import hooks and custom job queues. However, the promises module needed a bit of a refactor in order to couple with the new API. So, I thought it was a good idea to separate the promises refactor into its own PR, since the other PR is already big as it is. - Replaced some usages of `JobCallback` with a new `NativeJob` that isn't traced by the GC, since those closures are always rooted and executed by the `Context` globally. This will also allow hosts to pass their custom jobs to the job queue, and maybe could also accept futures in the Future (pun intended 😆). - Refactored several functions to account for the `HostPromiseRejectionTracker` hook which needs the promise `JsObject`. - Rewrote some patterns with newer Rust idioms. |
2 years ago |