mirror of https://github.com/boa-dev/boa.git
Tree:
96a6e0a346
add-vhs-ci
benchmarks
bump-temporal-version
control-flow-graph
dependabot/cargo/rust-dependencies-50dc4690b8
expect-lints
feature/node_span
feature/snapshot
features
gh-readonly-queue/main/pr-2877-b0ddf5eed00a53281d67fc7d846233fc0d99ce9c
gh-readonly-queue/main/pr-3144-8e48cec73fae708420b9af88813d4870243c491a
local-parameters-if-mapped-arguments-object-not-accessed
main
nan-boxing
optimization/static-shapes
real_conformance
refactor/interner
refactor/register-vm
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.20
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 }
1997 Commits (96a6e0a346c8e70230376ce3a713c76c33d10d9c)
Author | SHA1 | Message | Date |
---|---|---|---|
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 |
raskad | f19467ab1d |
Fix some HoistableDeclaration parsing errors (#2532)
This Pull Request hanges the following: - Add early errors for invalid `yield` and `await` usage in function parameters. - Add missing function types to hoistable ordering. - Do not attempt to parse `async` with a following line terminator as an async function. |
2 years ago |
dependabot[bot] | 0d599293fd |
Bump rustyline from 10.1.0 to 10.1.1 (#2549)
Bumps [rustyline](https://github.com/kkawakam/rustyline) from 10.1.0 to 10.1.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/kkawakam/rustyline/releases">rustyline's releases</a>.</em></p> <blockquote> <h2>10.1.1</h2> <p>Rollbacks incompatible changes relative to edition 2018 (<a href="https://github-redirect.dependabot.com/kkawakam/rustyline/issues/671">#671</a>) <strong>Full Changelog</strong>: <a href="https://github.com/kkawakam/rustyline/compare/v10.1.0...v10.1.1">https://github.com/kkawakam/rustyline/compare/v10.1.0...v10.1.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 2d8c6102ad |
Bump toml from 0.5.10 to 0.5.11 (#2548)
Bumps [toml](https://github.com/toml-rs/toml) from 0.5.10 to 0.5.11. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | eed1134dc0 |
Bump serde_yaml from 0.9.16 to 0.9.17 (#2550)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.9.16 to 0.9.17. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/serde-yaml/releases">serde_yaml's releases</a>.</em></p> <blockquote> <h2>0.9.17</h2> <ul> <li>Improve Debug representation of some error messages</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
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 |
dependabot[bot] | 20af6a7f17 |
Bump proc-macro2 from 1.0.49 to 1.0.50 (#2541)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.49 to 1.0.50. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/proc-macro2/releases">proc-macro2's releases</a>.</em></p> <blockquote> <h2>1.0.50</h2> <ul> <li>Implement Hash for proc_macro2::LineColumn (<a href="https://github-redirect.dependabot.com/dtolnay/proc-macro2/issues/362">#362</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
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 |
dependabot[bot] | b937a60602 |
Bump test262 from `e1048d0` to `2ac0d3c` (#2538)
Bumps [test262](https://github.com/tc39/test262) from `e1048d0` to `2ac0d3c`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | cd85040544 |
Bump clap from 4.0.32 to 4.1.1 (#2537)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.32 to 4.1.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.1</h2> <h2>[4.1.1] - 2023-01-14</h2> <h3>Fixes</h3> <ul> <li><em>(error)</em> Small softening attempt for "unexpected argument" error</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.1] - 2023-01-14</h2> <h3>Fixes</h3> <ul> <li><em>(error)</em> Small softening attempt for "unexpected argument" error</li> </ul> <h2>[4.1.0] - 2023-01-13</h2> <h3>Compatibility</h3> <p>MSRV changed to 1.64.0</p> <p>For apps with custom <code>--help</code> and <code>--version</code> flags:</p> <ul> <li>Descriptions for <code>--help</code> and <code>--version</code> changed</li> </ul> <p>When apps have errors imitating clap's error style:</p> <ul> <li>Error message style was changed, including <ul> <li>Moving away from "did you mean" to tips</li> <li>Leading letter is lower case</li> <li>"For more" added some punctuation</li> </ul> </li> </ul> <h3>Features</h3> <ul> <li><code>ArgMatches::get_occurrences</code> support for argument values to be grouped by their occurrence</li> </ul> <h3>Fixes</h3> <ul> <li><em>(derive)</em> Allow <code>upgrade_from</code> when arguments / subcommands are explicitly marked as required</li> <li><em>(help)</em> Try be more clearer and succinct with <code>--help</code> and <code>--version</code> (also helps with overflow)</li> <li><em>(error)</em> Try to be more clearer and succinct with error messages</li> <li><em>(error)</em> Officially adopt <a href="https://rustc-dev-guide.rust-lang.org/diagnostics.html#suggestion-style-guide">an error style guide</a></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 238c2937a3 |
Bump rustyline from 10.0.0 to 10.1.0 (#2536)
Bumps [rustyline](https://github.com/kkawakam/rustyline) from 10.0.0 to 10.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/kkawakam/rustyline/releases">rustyline's releases</a>.</em></p> <blockquote> <h2>10.1.0</h2> <h2>What's Changed</h2> <ul> <li>Upgrade nix dependency</li> <li>Fix ViFirstPrint movement (<a href="https://github-redirect.dependabot.com/kkawakam/rustyline/issues/645">#645</a>)</li> <li>Specify that <code>Editor::iter</code> ends at EOF (Fix <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/issues/647">#647</a>)</li> <li>Optim: do nothing on SIGWINCH if screen size doesn't impact current layout</li> <li>Upgrade skim dependency</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/kkawakam/rustyline/compare/v10.0.0...v10.1.0">https://github.com/kkawakam/rustyline/compare/v10.0.0...v10.1.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | cc79ea3af0 |
Bump prettier from 2.8.2 to 2.8.3 (#2535)
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.2 to 2.8.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p> <blockquote> <h2>2.8.3</h2> <p>Support Angular 15.1</p> <p>🔗 <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md#283">Changelog</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p> <blockquote> <h1>2.8.3</h1> <p><a href="https://github.com/prettier/prettier/compare/2.8.2...2.8.3">diff</a></p> <h4>Allow self-closing tags on custom elements (<a href="https://github-redirect.dependabot.com/prettier/prettier/pull/14170">#14170</a> by <a href="https://github.com/fisker"><code>@fisker</code></a>)</h4> <p>See <a href="https://github.com/angular/angular/releases/tag/15.1.0">Angular v15.1.0 release note</a> for details.</p> <!-- raw HTML omitted --> <pre lang="html"><code>// Input <app-test/> <p>// Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 |</p> <p>// Prettier 2.8.3 <app-test /> </code></pre></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
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 | f52d1d3eb5 |
Recognize Directive Prologues correctly (#2521)
This Pull Request changes the following: - Recognize the `"use strict"` directive prologue correctly. - Refactor parsers to remove a setter function. |
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 |
dependabot[bot] | f037a8e685 |
Bump bzip2 from 0.4.3 to 0.4.4 (#2527)
Bumps [bzip2](https://github.com/alexcrichton/bzip2-rs) from 0.4.3 to 0.4.4. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/alexcrichton/bzip2-rs/commits/0.4.4">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bzip2&package-manager=cargo&previous-version=0.4.3&new-version=0.4.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) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/boa-dev/boa/network/alerts). </details> |
2 years ago |
Kevin | 989edd42c7 |
`Break` Opcode and `ByteCompiler` changes (#2523)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> Hi all! 😄 This Pull Request addresses #2424. There are also a few changes made to the `ByteCompiler`, the majority of which are involving `JumpControlInfo`. It changes the following: - Adds `Break` Opcode - Shifts `compile_stmt` into the `statement` module. - Moves `JumpControlInfo` to it's own module. |
2 years ago |
raskad | be9ebc95c0 |
Add regex literal early errors (#2517)
This Pull Request changes the following: - Parse regex literals via `regress` during parsing to return errors in the regex as early syntax errors. |
2 years ago |
dependabot[bot] | 45982effcf |
Bump regex from 1.7.0 to 1.7.1 (#2526)
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.0 to 1.7.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p> <blockquote> <h1>1.7.1 (2023-01-09)</h1> <p>This release was done principally to try and fix the doc.rs rendering for the regex crate.</p> <p>Performance improvements:</p> <ul> <li>[PERF <a href="https://github-redirect.dependabot.com/rust-lang/regex/issues/930">#930</a>](<a href="https://github-redirect.dependabot.com/rust-lang/regex/pull/930">rust-lang/regex#930</a>): Optimize <code>replacen</code>. This also applies to <code>replace</code>, but not <code>replace_all</code>.</li> </ul> <p>Bug fixes:</p> <ul> <li>[BUG <a href="https://github-redirect.dependabot.com/rust-lang/regex/issues/945">#945</a>](<a href="https://github-redirect.dependabot.com/rust-lang/regex/issues/945">rust-lang/regex#945</a>): Maybe fix rustdoc rendering by just bumping a new release?</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 620dfd623f |
Bump test262 from `f00d411` to `e1048d0` (#2525)
Bumps [test262](https://github.com/tc39/test262) from `f00d411` to `e1048d0`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 2ab80e8e00 |
Bump prettier from 2.8.1 to 2.8.2 (#2524)
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.1 to 2.8.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p> <blockquote> <h2>2.8.2</h2> <p>🔗 <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md#282">Changelog</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p> <blockquote> <h1>2.8.2</h1> <p><a href="https://github.com/prettier/prettier/compare/2.8.1...2.8.2">diff</a></p> <h4>Don't lowercase link references (<a href="https://github-redirect.dependabot.com/prettier/prettier/pull/13155">#13155</a> by <a href="https://github.com/DerekNonGeneric"><code>@DerekNonGeneric</code></a> & <a href="https://github.com/fisker"><code>@fisker</code></a>)</h4> <!-- raw HTML omitted --> <pre lang="markdown"><code><!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. <p><!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by <a href="https://example.com/">Keep a Changelog</a>.</p> <p><!-- ^^^^^^^^^^^^^^^^^^ lowercased --></p> <p><!-- Prettier 2.8.2 --> <Same as input> </code></pre></p> <h4>Preserve self-closing tags (<a href="https://github-redirect.dependabot.com/prettier/prettier/pull/13691">#13691</a> by <a href="https://github.com/dcyriller"><code>@dcyriller</code></a>)</h4> <!-- raw HTML omitted --> <pre lang="hbs"><code>{{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> <p>{{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /></p> <p>{{! Prettier 2.8.2 }} </tr></table> </code></pre></p> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | edd404ba7f |
Redesign native functions and closures API (#2499)
This PR is a complete redesign of our current native functions and closures API.
I was a bit dissatisfied with our previous design (even though I created it 😆), because it had a lot of superfluous traits, a forced usage of `Gc<GcCell<T>>` and an overly restrictive `NativeObject` bound. This redesign, on the other hand, simplifies a lot our public API, with a simple `NativeCallable` struct that has several constructors for each type of required native function.
This new design doesn't require wrapping every capture type with `Gc<GcCell<T>>`, relaxes the trait requirement to `Trace + 'static` for captures, can be reused in both `JsObject` functions and (soonish) host defined functions, and is (in my opinion) a bit cleaner than the previous iteration. It also offers an `unsafe` API as an escape hatch for users that want to pass non-Copy closures which don't capture traceable types.
Would ask for bikeshedding about the names though, because I don't know if `NativeCallable` is the most precise name for this. Same about the constructor names; I added the `from` prefix to all of them because it's the "standard" practice, but seeing the API doesn't have any other method aside from `call`, it may be better to just remove the prefix altogether.
Let me know what you think :)
|
2 years ago |
raskad | 082d36280b |
Pass a receiver value in property getter opcodes (#2516)
This Pull Request changes the following: - Pass a receiver value to the object `get` function in the `GetPropertyBy*` opcodes. The receiver value may be different from the object, because `ToObject` is not called on it. |
2 years ago |
raskad | f998a1c1ec |
Add early errors for 'eval' or 'arguments' in parameters (#2515)
This Pull Request changes the following: - Add early errors for functions to make sure that 'eval' or 'arguments' cannot be used as binding identifiers in function parameters. When the function body contains a strict directive, this also has to be accounted for. - Fix early errors for function identifiers to make sure they cannot be 'eval' or 'arguments' when a function body contains a strict directive. |
2 years ago |
Veera | 616b7a4513 |
Remove `Literal::Undefined` (#2518)
<!--- 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 #2512 . Removes `Literal::Undefined` so that `undefined` is treated as an identifier name. Ran the parser's idempotency fuzzer and ensured the bug doesn't reproduce. |
2 years ago |
dependabot[bot] | 790877edc4 |
Bump tokio from 1.23.0 to 1.24.1 (#2519)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.0 to 1.24.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tokio-rs/tokio/releases">tokio's releases</a>.</em></p> <blockquote> <h2>Tokio v1.24.1</h2> <p>This release fixes a compilation failure on targets without <code>AtomicU64</code> when using rustc older than 1.63. (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5356">#5356</a>)</p> <p><a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5356">#5356</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5356">tokio-rs/tokio#5356</a></p> <h2>Tokio v1.24.0</h2> <p>The highlight of this release is the reduction of lock contention for all I/O operations (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5300">#5300</a>). We have received reports of up to a 20% improvement in CPU utilization and increased throughput for real-world I/O heavy applications.</p> <h3>Fixed</h3> <ul> <li>rt: improve native <code>AtomicU64</code> support detection (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5284">#5284</a>)</li> </ul> <h3>Added</h3> <ul> <li>rt: add configuration option for max number of I/O events polled from the OS per tick (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5186">#5186</a>)</li> <li>rt: add an environment variable for configuring the default number of worker threads per runtime instance (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/4250">#4250</a>)</li> </ul> <h3>Changed</h3> <ul> <li>sync: reduce MPSC channel stack usage (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5294">#5294</a>)</li> <li>io: reduce lock contention in I/O operations (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5300">#5300</a>)</li> <li>fs: speed up <code>read_dir()</code> by chunking operations (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5309">#5309</a>)</li> <li>rt: use internal <code>ThreadId</code> implementation (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5329">#5329</a>)</li> <li>test: don't auto-advance time when a <code>spawn_blocking</code> task is running (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5115">#5115</a>)</li> </ul> <p><a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5186">#5186</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5186">tokio-rs/tokio#5186</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5294">#5294</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5294">tokio-rs/tokio#5294</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5284">#5284</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5284">tokio-rs/tokio#5284</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/4250">#4250</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/4250">tokio-rs/tokio#4250</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5300">#5300</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5300">tokio-rs/tokio#5300</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5329">#5329</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5329">tokio-rs/tokio#5329</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5115">#5115</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5115">tokio-rs/tokio#5115</a> <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5309">#5309</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5309">tokio-rs/tokio#5309</a></p> <h2>Tokio v1.23.1</h2> <p>This release forward ports changes from 1.18.4.</p> <h3>Fixed</h3> <ul> <li>net: fix Windows named pipe server builder to maintain option when toggling pipe mode (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5336">#5336</a>).</li> </ul> <p><a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5336">#5336</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5336">tokio-rs/tokio#5336</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 1dcd932f1f |
Fix postfix operator line terminator parsing (#2520)
Postfix increment / decrement operators require that there is no line terminator between the LHS expression and the operator. This was previously ignored. |
2 years ago |
dependabot[bot] | 3d5debac65 |
Bump arbitrary from 1.2.0 to 1.2.2 (#2514)
Bumps [arbitrary](https://github.com/rust-fuzz/arbitrary) from 1.2.0 to 1.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-fuzz/arbitrary/blob/main/CHANGELOG.md">arbitrary's changelog</a>.</em></p> <blockquote> <h2>1.2.2</h2> <p>Released 2023-01-03.</p> <h3>Fixed</h3> <ul> <li>Ensured that <code>arbitrary</code> and <code>derive_arbitrary</code> versions are synced up so that they don't, e.g., emit generated code that depends on newer versions of <code>arbitrary</code> than the one currently in use. <a href="https://github-redirect.dependabot.com/rust-fuzz/arbitrary/issues/134">#134</a></li> </ul> <h2>1.2.1</h2> <h3>Fixed</h3> <ul> <li>Fixed an issue where <code>std::thread_local!</code> macro invocations in derive code were not fully prefixed, causing confusing build errors in certain situations.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/rust-fuzz/arbitrary/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=arbitrary&package-manager=cargo&previous-version=1.2.0&new-version=1.2.2)](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 |
dependabot[bot] | 1b04c9eafd |
Bump json5 from 2.2.1 to 2.2.2 (#2511)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/json5/json5/releases">json5's releases</a>.</em></p> <blockquote> <h2>v2.2.2</h2> <ul> <li>Fix: Properties with the name <code>__proto__</code> are added to objects and arrays. (<a href="https://github-redirect.dependabot.com/json5/json5/issues/199">#199</a>) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (<a href="https://github-redirect.dependabot.com/json5/json5/issues/295">#295</a>).</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/json5/json5/blob/main/CHANGELOG.md">json5's changelog</a>.</em></p> <blockquote> <h3>v2.2.2 [<a href="https://github.com/json5/json5/tree/v2.2.2">code</a>, <a href="https://github.com/json5/json5/compare/v2.2.1...v2.2.2">diff</a>]</h3> <ul> <li>Fix: Properties with the name <code>__proto__</code> are added to objects and arrays. (<a href="https://github-redirect.dependabot.com/json5/json5/issues/199">#199</a>) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (<a href="https://github-redirect.dependabot.com/json5/json5/issues/295">#295</a>).</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 5aac69c27d |
Bump once_cell from 1.16.0 to 1.17.0 (#2510)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.16.0 to 1.17.0. <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.0</h2> <ul> <li>Add <code>race::OnceRef</code> for storing a <code>&'a T</code>.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Veera | f216a6dda9 |
Fix unary operations on `this` (#2507)
<!--- 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 #2416. Previously, prefix increment and decrement operations on `this` caused a panic. This PR makes the parser issue a syntax error when the operand UnaryExpression is not simple (as mentioned in https://tc39.es/ecma262/#sec-update-expressions-static-semantics-early-errors). |
2 years ago |
José Julián Espina | 81680ff5c4 |
Pass locale data provider by ref instead of boxing (#2508)
This change is actually pretty simple, but since now we have to pass a lifetime parameter to all references of `Context`, it touches a lot of files. Relevant changes: - https://github.com/boa-dev/boa/pull/2508/files#diff-73e17259d77e5fbef83b2bdbbe4dc40a912f807472287f7f45b77e0cbf78792d - https://github.com/boa-dev/boa/pull/2508/files#diff-e7ebcd61f7a01c432b62e1742a6cfd8e28326a1f2b6afb37ba66d4964b3db521 - https://github.com/boa-dev/boa/pull/2508/files#diff-7b2a85f5aa9b5a8070e04e87a67b4f7cc700a43a520e0d6cc6e0b701711ccb7c - https://github.com/boa-dev/boa/pull/2508/files#diff-872037c107c01bf644ede412e4802b3eefeb5a70ce595c441f75651d45111b2a - https://github.com/boa-dev/boa/pull/2508/files#diff-a665b3b6f564521875fd0d725bffbc4f0cc84e5feefdc5fd875fd943e56311cd - https://github.com/boa-dev/boa/pull/2508/files#diff-3e1f19581f227120ddc3334fd0450152b767811c9b6cb4048581347fcd9fc91d - https://github.com/boa-dev/boa/pull/2508/files#diff-5fe65193a910618375d9575d918cd584430437ee2738a987c92068dea3117297 - https://github.com/boa-dev/boa/pull/2508/files#diff-4ce8770f8aaf50785ece12a9a15b781a544bfc47f080e2ff62ddfb18264a44ef All the other changes are just replacing `Context` with `Context<'_>`. |
2 years ago |
Choongwoo Han | 95a1d9e54f |
[profiler] Cache StringId (#2495)
boa_profiler was allocating new strings every time even when they are the same string, which leads to a crash when `start_event` is called too much. This change updates the profiler to use a hash map cache and avoid duplicate string allocations. |
2 years ago |
José Julián Espina | cbf07824cb |
Cleanup `Context` APIs (#2504)
Just a general cleanup of the APIs of our `Context`. - Reordered the `pub` and `pub(crate)/fn` methods to have a clear separation between our public and private APIs. - Removed the call method and added it to `JsValue` instead, which semantically makes a bit more sense. - Removed the `construct_object` method, and added an utility method `new` to `JsObject` instead. - Rewrote some patterns I found while rewriting the calls of the removed function. |
2 years ago |
Karol Janik | e707d87a9b |
replace deprecated set-output command (#2500)
<!--- 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 #2415. It changes the following: - Replaced deprecated set-output command following [GitHub guide](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) Co-authored-by: karol-janik <karol.janik@wpengine.com> |
2 years ago |
dependabot[bot] | dcacc638aa |
Bump serde from 1.0.151 to 1.0.152 (#2509)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.151 to 1.0.152. <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.152</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Choongwoo Han | ab2e6e1ab3 |
Use opcode table rather than match (#2501)
`execute_instruction` is heavily used. After decoding an opcode, `match` is used to find a proper `execute` function for the opcode. But, the `match` may not be able to be optimized into a table jump by rust compiler, so it may use multiple branches to find the function. When I tested with a toy program, only `enum -> &'static str` case was optimized to use a table while `enum -> function call` uses multiple branches. ([gotbolt](https://rust.godbolt.org/z/1rzK5vj6f)) This change makes the opcode to use a table explicitly. It improves the benchmark score of Richards by 1-2% (22.8 -> 23.2). |
2 years ago |
José Julián Espina | 3bf5de2929 |
Redesign Intl API and implement some services (#2478)
This Pull Request fixes/closes #1180. (I'll open a tracking issue for the progress) It changes the following: - Redesigns the internal API of Intl to (hopefully!) make it easier to implement a service. - Implements the `Intl.Locale` service. - Implements the `Intl.Collator` service. - Implements the `Intl.ListFormat` service. On the subject of the failing tests. Some of them are caused by missing locale data in the `icu_testdata` crate; we would need to regenerate that with the missing locales, or vendor a custom default data. On the other hand, there are some tests that are bugs from the ICU4X crate. The repo https://github.com/jedel1043/icu4x-test262 currently tracks the found bugs when running test262. I'll sync with the ICU4X team to try to fix those. cc @sffc |
2 years ago |
dependabot[bot] | f871697670 |
Bump test262 from `9f6da57` to `f00d411` (#2506)
Bumps [test262](https://github.com/tc39/test262) from `9f6da57` to `f00d411`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ce3b20a5bb |
Bump clap from 4.0.30 to 4.0.32 (#2505)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.30 to 4.0.32. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.0.32</h2> <h2>[4.0.32] - 2022-12-22</h2> <h3>Fixes</h3> <ul> <li><em>(parser)</em> When overriding <code>required(true)</code>, consider args that conflict with its group</li> </ul> <h2>v4.0.31</h2> <h2>[4.0.31] - 2022-12-22</h2> <h3>Performance</h3> <ul> <li>Speed up parsing when a lot of different flags are present (100 unique flags)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.0.32] - 2022-12-22</h2> <h3>Fixes</h3> <ul> <li><em>(parser)</em> When overriding <code>required(true)</code>, consider args that conflict with its group</li> </ul> <h2>[4.0.31] - 2022-12-22</h2> <h3>Performance</h3> <ul> <li>Speed up parsing when a lot of different flags are present (100 unique flags)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | c4eabd20c7 |
Bump clap from 4.0.29 to 4.0.30 (#2502)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.29 to 4.0.30. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.0.30</h2> <h2>[4.0.30] - 2022-12-21</h2> <h3>Fixes</h3> <ul> <li><em>(error)</em> Improve error for <code>args_conflicts_with_subcommand</code></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.0.30] - 2022-12-21</h2> <h3>Fixes</h3> <ul> <li><em>(error)</em> Improve error for <code>args_conflicts_with_subcommand</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | cc45a827ca |
Cleanup inline annotations (#2493)
Per the [Standard Library development guide](https://std-dev-guide.rust-lang.org/code-considerations/performance/inline.html): > You can add `#[inline]`: > > - To public, small, non-generic functions. > > You shouldn't need `#[inline]`: > - On methods that have any generics in scope. > - On methods on traits that don't have a default implementation. > > `#[inline]` can always be introduced later, so if you're in doubt they can just be removed. This PR follows this guideline to reduce the number of `#[inline]` annotations in our code, removing the annotation in: - Non-public functions - Generic functions - Medium and big functions. Hopefully this shouldn't impact our perf at all, but let's wait to see the benchmark results. |
2 years ago |
José Julián Espina | 850a20b988 |
Replace `criterion::black_box` with `std::hint::black_box` (#2494)
This Pull Request replaces the `criterion::black_box` function with the recently stabilized `std::hint::black_box` intrinsic. |
2 years ago |
dependabot[bot] | 69067cac22 |
Bump serde from 1.0.150 to 1.0.151 (#2497)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.150 to 1.0.151. <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.151</h2> <ul> <li>Update <code>serde::</code>{<code>ser</code>,<code>de</code>}<code>::StdError</code> to re-export <code>core::error::Error</code> when serde is built with <code>feature="std"</code> <strong>off</strong> and <code>feature="unstable"</code> <strong>on</strong> (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2344">#2344</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 4660579490 |
Bump thiserror from 1.0.37 to 1.0.38 (#2498)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.37 to 1.0.38. <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.38</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 0d82ef0653 |
Bump serde_json from 1.0.89 to 1.0.91 (#2496)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.89 to 1.0.91. <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.91</h2> <ul> <li>Opt out of <code>-Zrustdoc-scrape-examples</code> on docs.rs for now</li> </ul> <h2>v1.0.90</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |