mirror of https://github.com/boa-dev/boa.git
Tree:
9c2bc0a7a6
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
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 }
238 Commits (9c2bc0a7a6d34ed1cbfd44c6cffd11b7a22123bd)
Author | SHA1 | Message | Date |
---|---|---|---|
dependabot[bot] | e0df739b5a |
Bump serde from 1.0.139 to 1.0.140 (#2198)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.139 to 1.0.140. <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.140</h2> <ul> <li>Invert serde_derive cfgs to convenience non-Cargo builds on a modern toolchain (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2251">#2251</a>, thanks <a href="https://github.com/taiki-e"><code>@taiki-e</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Halid Odat | efff9d6269 |
Fix length/index in `32bit` architectures (#2196)
This PR fixes the length/index types from `usize` to `u64`, because in JavaScript the length can be from `0` to `2^53 - 1` it cannot be represented in a `usize`. On `64-bit` architectures this is fine because it is already a unsigned 64bit number and these changes essentially do nothing. But on 32bit architectures this was causing the length to be truncated giving an unexpected result. fixes/closes #2182 It changes the following: - Make length a `u64` to be able to represent all possible length values - Change `JsValue::to_length()` t return `u64` - Change `JsValue::to_index()` t return `u64` |
2 years ago |
dependabot[bot] | 709cc343da |
Bump dyn-clone from 1.0.7 to 1.0.8 (#2188)
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.7 to 1.0.8. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/dyn-clone/releases">dyn-clone's releases</a>.</em></p> <blockquote> <h2>1.0.8</h2> <ul> <li>Add functions that do <code>Arc::make_mut</code> and <code>Rc::make_mut</code> but work with element type <code>dyn Trait</code> (<a href="https://github-redirect.dependabot.com/dtolnay/dyn-clone/issues/21">#21</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 32e0446738 |
Bump dyn-clone from 1.0.6 to 1.0.7 (#2178)
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.6 to 1.0.7. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/dyn-clone/releases">dyn-clone's releases</a>.</em></p> <blockquote> <h2>1.0.7</h2> <ul> <li>Add support for <code>str</code> and <code>[T]</code> to implements traits that have <code>DynClone</code> as a supertrait (<a href="https://github-redirect.dependabot.com/dtolnay/dyn-clone/issues/19">#19</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 6e377d6467 |
Implement Generator Function Constructor (#2174)
This Pull Request changes the following: - Modify `CreateDynamicFunction` to work with generator functions. - Add the name `anonymus` to functions created via `CreateDynamicFunction` to comply with the spec. - Fix a bug in the `Yield` parser where the parser would expect a token when no token is a legal case. - Change the `Yield::new` function to require less turbofishes. |
2 years ago |
raskad | d8af7b4ee5 |
Implement arrow function parsing based on `CoverParenthesizedExpressionAndArrowParameterList` (#2171)
Previously we parsed arrow functions without the relevant cover grammar `CoverParenthesizedExpressionAndArrowParameterList`. This leads to either arrow functions or parenthesized expressions not being parsed correctly. Implementing this is a bit tricky, as the cover grammar is being parsed in `PrimaryExpression` while arrow functions are parsed in `AssignmentExpression`. This means that we have to return the covered parameter list that was parsed via `CoverParenthesizedExpressionAndArrowParameterList` in `PrimaryExpression` to `AssignmentExpression`. Fortunately this works pretty good and now the full arrow function test suite, with the exception of a few tests that require other features, passes. This Pull Request changes the following: - Implement `CoverParenthesizedExpressionAndArrowParameterList` parsing. - Implement `CoverInitializedName` parsing in object literals. - Fix a bug where an environment would be wrongly removed from the environment stack when an expression in default function parameters throws. - Add more valid cases where on object literal can be converted to an object declaration pattern. - Implement `Expression` parsing manually to avoid some cases where the parser would prematurely throw an error. - Implement parsing of arrow functions via `CoverParenthesizedExpressionAndArrowParameterList`. - Remove unneeded `AllowIn` flag on array and object declaration pattern parsers. - Fix an of-by-one bug in the trace output. |
2 years ago |
dependabot[bot] | 6c65aa350b |
Bump serde from 1.0.138 to 1.0.139 (#2173)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.138 to 1.0.139. <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.139</h2> <ul> <li>Add <code>new</code> constructor function for all <code>IntoDeserializer</code> impls (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2246">#2246</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Halid Odat | 48d8b420c5 |
Implement `JsArrayBuffer` (#2170)
This PR adds the `ArrayBuffer` rust wrapper. It also provides a capability to construct a `JsArrayBuffer` from a user defined blob of data ( `Vec<u8>` ) and it is not cloned, it is directly used as the internal buffer. This allows us to replace the inifficent `Vec<u8>` to `JsArray` then to `TypedArray` (in typed arrays `from_iter`), with a `JsArrayBuffer` created from user data to `TypedArray`. With this `Vec<u8>` to `JsTypedArray` should be fully fixed as discussed in #2058. |
2 years ago |
Anuvrat Singh | 52bc15bc23 |
Safe wrapper for `JsSet` (#2162)
This PR adds a safe wrapper around JavaScript `JsSet` from `builtins::set`, and is being tracked at #2098. Implements following methods - [x] `Set.prototype.size` - [x] `Set.prototype.add(value)` - [x] `Set.prototype.clear()` - [x] `Set.prototype.delete(value)` - [x] `Set.prototype.has(value)` - [x] `Set.prototype.forEach(callbackFn[, thisArg])` Implement wrapper for `builtins::set_iterator`, to be used by following. - [x] `Set.prototype.values()` - [x] `Set.prototype.keys()` - [x] `Set.prototype.entries()` *Note: Are there any other functions that should be added? Also adds `set_create()` and made `get_size()` public in `builtins::set`. |
2 years ago |
dependabot[bot] | d7fb049082 |
Bump unicode-normalization from 0.1.20 to 0.1.21 (#2160)
Bumps [unicode-normalization](https://github.com/unicode-rs/unicode-normalization) from 0.1.20 to 0.1.21. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/unicode-rs/unicode-normalization/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=unicode-normalization&package-manager=cargo&previous-version=0.1.20&new-version=0.1.21)](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 |
Halid Odat | 5bbc225b24 |
Dense/Packed JavaScript arrays (#2167)
This PR implements an optimization done by V8 and spidermonkey. Which stores indexed properties in two class storage methods dense and sparse. The dense method stores the property in a contiguous array ( `Vec<T>` ) where the index is the property key. This storage method is the default. While on the other hand we have sparse storage method which stores them in a hash map with key `u32` (like we currently do). This storage method is a backup and is slower to access because we have to do a hash map lookup, instead of an array access. In the dense array we can store only data descriptors that have a value field and are `writable`, `configurable` and `enumerable` (which by default array elements are). Since all the fields of the property descriptor are the same except value field, we can omit them an just store the `JsValue`s in `Vec<JsValue>` this decreases the memory consumption and because it is smaller we are less likely to have cache misses. There are cases where we have to convert from dense to sparse (the slow case): - If we insert index elements in a non-incremental way, like `array[1000] = 1000` (inserting an element to an index that is already occupied only replaces it does not make it sparse) - If we delete from the middle of the array (making a hole), like `delete array[10]` (only converts if there is actualy an element there, so calling delete on a non-existent index property will do nothing) Once it becomes sparse is *stays* sparse there is no way to convert it again. (the computation needed to check whether it can be converted outweighs the benefits of this optimization) I did some local benchmarks and on array creation/pop and push there is ~45% speed up and the impact _should_ be bigger the more elements we have. For example the code below on `main` takes `~21.5s` while with this optimization is `~3.5s` (both on release build). ```js let array = []; for (let i = 0; i < 50000; ++i) { array[i] = i; } ``` In addition I also made `Array::create_array_from_list` do a direct setting of the properties (small deviation from spec but it should have the same behaviour), with this #2058 should be fixed, conversion from `Vec` to `JsArray`, not `JsTypedArray` for that I will work on next :) |
2 years ago |
Kevin | d0d70345eb |
Implementation of JsMap Wrapper (#2115)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel neccessary. ---> This Pull Request related to JsMap for #2098. Any feedback on implementing JsMapIterator would be welcome. I wasn't entirely sure if it was the right approach, but as I worked on the example file, it felt like something at least similar would be needed to use Map's .entries(), .keys(), and .values() methods. It changes the following: - Implements JsMap Wrapper - Implements JsMapIterator Wrapper - Creates JsMap example in boa_examples |
2 years ago |
dependabot[bot] | 7a5da521d2 |
Bump once_cell from 1.12.0 to 1.13.0 (#2165)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.0 to 1.13.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.13.0</h2> <ul> <li>Add <code>Lazy::get</code>, similar to <code>OnceCell::get</code>.</li> </ul> <h2>1.12.1</h2> <ul> <li>Remove incorrect <code>debug_assert</code>.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Halid Odat | 64f59ddacb |
Store call frames in `Vec` instead of singly-linked list (#2164)
This storage method should be more cache friendly since we store in contiguous memory, besides that it should make #2157 a bit easier. Will work on that next after this gets merged :) It changes the following: - Remove the unneeded `prev` field in `CallFrame` - Preallocate some space for future calls (16 slots) |
2 years ago |
raskad | cdc49e35ea |
Implement `async function` and `await` (#2158)
This Pull Request changes the following: - Implement `AsyncFunction` builtin object. - Add `Async` as a function object data type. - Implement `async function` and `await` compilation and execution. - Parse `await` in more positions. |
2 years ago |
dependabot[bot] | cdaffa788a |
Bump serde from 1.0.137 to 1.0.138 (#2159)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.137 to 1.0.138. <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.138</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | bd0bf78383 |
Fix remaining `Promise` bugs (#2156)
This Pull Request changes the following: - Fix `Promise.then` length to 2. - Fix `all`, `allSettled` and `any` element lists to actually be shared between closures. - Fix `allSettled` reject element function to call resolve instead of reject. The remaining failing tests for `Promise` fail because of some errors in the arrow function parsing. |
2 years ago |
raskad | aaeee43c4f |
Fix `this` in function calls (#2153)
This Pull Request changes the following: - Fix the `this` value that is passend to function calls to be `undefined` if the function is not a property reference - Add special handling for setting the `this` value for function calls where the function is a private property reference or a super property reference |
2 years ago |
raskad | 6b4ebf9e3e |
Fix clippy 1.62.0 lints (#2154)
This Pull Request changes the following: - Fix clippy 1.62.0 lints |
2 years ago |
jedel1043 | f7aef10a61 |
Remove `string-interner` dependency and implement custom string `Interner` (#2147)
So, @raskad and myself had a short discussion about the state of #736, and we came to the conclusion that it would be a good time to implement our own string interner; partly because the `string-interner` crate is a bit unmaintained (as shown by https://github.com/Robbepop/string-interner/pull/42 and https://github.com/Robbepop/string-interner/pull/47), and partly because it would be hard to experiment with custom optimizations for UTF-16 strings. I still want to thank @Robbepop for the original implementation though, because some parts of this design have been shamelessly stolen from it 😅. Having said that, this PR is a complete reimplementation of the interner, but with some modifications to (hopefully!) make it a bit easier to experiment with UTF-16 strings, apply optimizations, and whatnot :) |
2 years ago |
dependabot[bot] | 8657dd2b11 |
Bump serde_json from 1.0.81 to 1.0.82 (#2152)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.81 to 1.0.82. <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.82</h2> <ul> <li>Implement <code>From<Option<T>></code> for serde_json::Value where <code>T: Into<Value></code> (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/900">#900</a>, thanks <a href="https://github.com/kvnvelasco"><code>@kvnvelasco</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 13df9a1984 |
Implement `super` expressions (#2116)
This Pull Request changes the following: - Implement `super` expression parsing / execution. - Implement early errors for `super` expressions. - Refactor / add internal slot representation for environment and function objects. |
2 years ago |
raskad | c561aa3b2c |
Implement `Promise.allSettled` (#2146)
This Pull Request changes the following: - Implement `Promise.allSettled` |
2 years ago |
raskad | e81e06b462 |
Implement `Promise.any` (#2145)
This Pull Request changes the following: - Implement `Promise.any` |
2 years ago |
dependabot[bot] | 724d182570 |
Bump unicode-normalization from 0.1.19 to 0.1.20 (#2142)
Bumps [unicode-normalization](https://github.com/unicode-rs/unicode-normalization) from 0.1.19 to 0.1.20. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/unicode-rs/unicode-normalization/commits/v0.1.20">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=unicode-normalization&package-manager=cargo&previous-version=0.1.19&new-version=0.1.20)](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 |
raskad | b043bca081 |
Implement `Promise.all` (#2140)
This Pull Request changes the following: - Implement `Promise.all` |
2 years ago |
dependabot[bot] | d355d3c3a6 |
Bump indexmap from 1.9.0 to 1.9.1 (#2139)
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.9.0 to 1.9.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bluss/indexmap/blob/master/RELEASES.md">indexmap's changelog</a>.</em></p> <blockquote> <ul> <li> <p>1.9.1</p> <ul> <li>The MSRV now allows Rust 1.56.0 as well. However, currently <code>hashbrown</code> 0.12.1 requires 1.56.1, so users on 1.56.0 should downgrade that to 0.12.0 until there is a later published version relaxing its requirement.</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
jedel1043 | 0ebb3cf439 |
Refactor `construct` and `PromiseCapability` to preserve `JsObject` invariants (#2136)
This Pull Request changes the signature of `construct` to always return `JsObject`s, and refactors `PromiseCapability` to store only `JsObject`/`JsFunction`s. This preserves the following invariants specified in the spec: https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-ecmascript-function-objects-construct-argumentslist-newtarget > The [[Construct]] internal method of an ECMAScript function object ... returns either a normal completion containing an Object or a throw completion ... https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promisecapability-records Table 82: [PromiseCapability Record](https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promisecapability-records) Fields Field Name | Value | Meaning -- | -- | -- [[Promise]] | an Object | An object that is usable as a promise. [[Resolve]] | a function object | The function that is used to resolve the given promise. [[Reject]] | a function object | The function that is used to reject the given promise. Co-authored-by: Iban Eguia <razican@protonmail.ch> |
2 years ago |
raskad | 613f4c3eab |
Fix for in/of loop initializer environment (#2135)
This Pull Request changes the following: - Add an additional environment when a for in/of loop is initialized with a `let` or `const` binding. |
2 years ago |
dependabot[bot] | 39cd3b8bdf |
Bump dyn-clone from 1.0.5 to 1.0.6 (#2133)
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.5 to 1.0.6. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 43f60e9bb1 |
Fix `eval` attributes (#2130)
This Pull Request changes the following: - Fix `eval` attributes - Fix `eval` length - Fix `eval` name |
2 years ago |
Iban Eguia | d173e08529 |
Started adding the [[Done]] field to iterators (#2125)
This Pull Request adds the `[[Done]]` field to iterator records. Co-authored-by: raskad <32105367+raskad@users.noreply.github.com> |
2 years ago |
dependabot[bot] | 4f95eb756d |
Bump sys-locale from 0.2.0 to 0.2.1 (#2128)
Bumps [sys-locale](https://github.com/1Password/sys-locale) from 0.2.0 to 0.2.1. <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.1</h2> <p>See <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md#020---2022-03-01">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> <h2>[0.2.1] - 2022-06-16</h2> <h3>New</h3> <ul> <li>The crate now supports being used via WASM in a WebWorker environment.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 94b2b096fc |
Bump indexmap from 1.8.2 to 1.9.0 (#2129)
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.8.2 to 1.9.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bluss/indexmap/blob/master/RELEASES.md">indexmap's changelog</a>.</em></p> <blockquote> <ul> <li> <p>1.9.0</p> <ul> <li> <p><strong>MSRV</strong>: Rust 1.56.1 or later is now required.</p> </li> <li> <p>The <code>hashbrown</code> dependency has been updated to version 0.12.</p> </li> <li> <p><code>IterMut</code> and <code>ValuesMut</code> now implement <code>Debug</code>.</p> </li> <li> <p>The new <code>IndexMap::shrink_to</code> and <code>IndexSet::shrink_to</code> methods shrink the capacity with a lower bound.</p> </li> <li> <p>The new <code>IndexMap::move_index</code> and <code>IndexSet::move_index</code> methods change the position of an item from one index to another, shifting the items between to accommodate the move.</p> </li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Iban Eguia | 0454ddec19 |
Execution stack & promises (#2107)
This PR overrides #1923. It also removes the `queues` dependency added there, and rebases it to the latest `main` branch state. It adds the following: - A job queue (in `Context`) - The constructor [`Promise`](https://tc39.es/ecma262/#sec-promise-executor) - [`Promise.race`](https://tc39.es/ecma262/#sec-promise.race) - [`Promise.reject`](https://tc39.es/ecma262/#sec-promise.reject) - [`Promise.resolve`](https://tc39.es/ecma262/#sec-promise.resolve) - [`get Promise [ @@species ]`](https://tc39.es/ecma262/#sec-get-promise-@@species) - [`Promise.prototype [ @@toStringTag ]`](https://tc39.es/ecma262/#sec-promise.prototype-@@tostringtag) - [`Promise.prototype.then`](https://tc39.es/ecma262/#sec-promise.prototype.then) - [`Promise.prototype.finally`](https://tc39.es/ecma262/#sec-promise.prototype.finally) - [`Promise.prototype.catch`](https://tc39.es/ecma262/#sec-promise.prototype.catch) - The additional needed infrastructure - [`PerformPromiseThen ( promise, onFulfilled, onRejected [ , resultCapability ] )`](https://tc39.es/ecma262/#sec-performpromisethen) - [`TriggerPromiseReactions ( reactions, argument )`](https://tc39.es/ecma262/#sec-triggerpromisereactions) - [`PerformPromiseRace ( iteratorRecord, constructor, resultCapability, promiseResolve )`](https://tc39.es/ecma262/#sec-performpromiserace) - [`RejectPromise ( promise, reason )`](https://tc39.es/ecma262/#sec-rejectpromise) - [`FulfillPromise ( promise, value )`](https://tc39.es/ecma262/#sec-fulfillpromise) - [`IfAbruptRejectPromise ( value, capability )`](https://tc39.es/ecma262/#sec-ifabruptrejectpromise) - [`CreateResolvingFunctions ( promise )`](https://tc39.es/ecma262/#sec-createresolvingfunctions) - [`NewPromiseCapability ( C )`](https://tc39.es/ecma262/#sec-newpromisecapability) - [`NewPromiseReactionJob ( reaction, argument )`](https://tc39.es/ecma262/#sec-newpromisereactionjob) - [`NewPromiseResolveThenableJob ( promiseToResolve, thenable, then )`](https://tc39.es/ecma262/#sec-newpromiseresolvethenablejob) - [`PromiseResolve ( C, x )`](https://tc39.es/ecma262/#sec-promise-resolve) - A test case showcasing the run-to-completion semantics. An example program that shows the control flow with this addition is: ```javascript new Promise((res, rej) => { console.log("A"); res(undefined); }).then((_) => console.log("B")); console.log("C"); ``` Which would output: ``` A C B ``` |
2 years ago |
Sorck | 6477f61fb1 |
Implement Object.prototype.__lookupSetter__ (#2113)
This Pull Request closes #2067 It changes the following: - Implement `Object.prototype.__lookupSetter__` This passes all tests from `./test262/test/built-ins/Object/prototype/__lookupSetter__/` ``` Loading the test suite... Test suite loaded, starting tests... Suite __lookupSetter__: `lookup-own-get-err` (strict mode): starting `lookup-own-get-err` (strict mode): Passed `lookup-own-get-err`: starting `lookup-own-get-err`: Passed `length` (strict mode): starting `length` (strict mode): Passed `length`: starting `length`: Passed `lookup-proto-proto-err` (strict mode): starting `lookup-proto-proto-err` (strict mode): Passed `lookup-proto-proto-err`: starting `lookup-proto-proto-err`: Passed `lookup-own-acsr-wo-setter` (strict mode): starting `lookup-own-acsr-wo-setter` (strict mode): Passed `lookup-own-acsr-wo-setter`: starting `lookup-own-acsr-wo-setter`: Passed `lookup-not-found` (strict mode): starting `lookup-not-found` (strict mode): Passed `lookup-not-found`: starting `lookup-not-found`: Passed `lookup-proto-acsr-wo-setter` (strict mode): starting `lookup-proto-acsr-wo-setter` (strict mode): Passed `lookup-proto-acsr-wo-setter`: starting `lookup-proto-acsr-wo-setter`: Passed `lookup-proto-acsr-w-setter` (strict mode): starting `lookup-proto-acsr-w-setter` (strict mode): Passed `lookup-proto-acsr-w-setter`: starting `lookup-proto-acsr-w-setter`: Passed `name` (strict mode): starting `name` (strict mode): Passed `name`: starting `name`: Passed `lookup-own-acsr-w-setter` (strict mode): starting `lookup-own-acsr-w-setter` (strict mode): Passed `lookup-own-acsr-w-setter`: starting `lookup-own-acsr-w-setter`: Passed `lookup-own-proto-err` (strict mode): starting `lookup-own-proto-err` (strict mode): Passed `lookup-own-proto-err`: starting `lookup-own-proto-err`: Passed `lookup-proto-data` (strict mode): starting `lookup-proto-data` (strict mode): Passed `lookup-proto-data`: starting `lookup-proto-data`: Passed `lookup-own-data` (strict mode): starting `lookup-own-data` (strict mode): Passed `lookup-own-data`: starting `lookup-own-data`: Passed `lookup-proto-get-err` (strict mode): starting `lookup-proto-get-err` (strict mode): Passed `lookup-proto-get-err`: starting `lookup-proto-get-err`: Passed `prop-desc` (strict mode): starting `prop-desc` (strict mode): Passed `prop-desc`: starting `prop-desc`: Passed `key-invalid` (strict mode): starting `key-invalid` (strict mode): Passed `key-invalid`: starting `key-invalid`: Passed `this-non-obj` (strict mode): starting `this-non-obj` (strict mode): Passed `this-non-obj`: starting `this-non-obj`: Passed Suite __lookupSetter__ results: total: 32, passed: 32, ignored: 0, failed: 0 (panics: 0), conformance: 100.00% Results: Total tests: 32 Passed tests: 32 Ignored tests: 0 Failed tests: 0 (panics: 0) Conformance: 100.00% ``` |
2 years ago |
Sorck | c9b891fbfd |
Implement Object.prototype.__lookupGetter__ (#2112)
This Pull Request fixes part of #2067 It changes the following: - Implement `Object.prototype.__lookupGetter__` This passes all tests from `./test262/test/built-ins/Object/prototype/__lookupGetter__/` ``` Loading the test suite... Test suite loaded, starting tests... Suite __lookupGetter__: `lookup-own-get-err` (strict mode): starting `lookup-own-get-err` (strict mode): Passed `lookup-own-get-err`: starting `lookup-own-get-err`: Passed `length` (strict mode): starting `length` (strict mode): Passed `length`: starting `length`: Passed `lookup-proto-proto-err` (strict mode): starting `lookup-proto-proto-err` (strict mode): Passed `lookup-proto-proto-err`: starting `lookup-proto-proto-err`: Passed `lookup-not-found` (strict mode): starting `lookup-not-found` (strict mode): Passed `lookup-not-found`: starting `lookup-not-found`: Passed `lookup-own-acsr-wo-getter` (strict mode): starting `lookup-own-acsr-wo-getter` (strict mode): Passed `lookup-own-acsr-wo-getter`: starting `lookup-own-acsr-wo-getter`: Passed `name` (strict mode): starting `name` (strict mode): Passed `name`: starting `name`: Passed `lookup-own-acsr-w-getter` (strict mode): starting `lookup-own-acsr-w-getter` (strict mode): Passed `lookup-own-acsr-w-getter`: starting `lookup-own-acsr-w-getter`: Passed `lookup-own-proto-err` (strict mode): starting `lookup-own-proto-err` (strict mode): Passed `lookup-own-proto-err`: starting `lookup-own-proto-err`: Passed `lookup-proto-data` (strict mode): starting `lookup-proto-data` (strict mode): Passed `lookup-proto-data`: starting `lookup-proto-data`: Passed `lookup-proto-acsr-w-getter` (strict mode): starting `lookup-proto-acsr-w-getter` (strict mode): Passed `lookup-proto-acsr-w-getter`: starting `lookup-proto-acsr-w-getter`: Passed `lookup-own-data` (strict mode): starting `lookup-own-data` (strict mode): Passed `lookup-own-data`: starting `lookup-own-data`: Passed `lookup-proto-acsr-wo-getter` (strict mode): starting `lookup-proto-acsr-wo-getter` (strict mode): Passed `lookup-proto-acsr-wo-getter`: starting `lookup-proto-acsr-wo-getter`: Passed `lookup-proto-get-err` (strict mode): starting `lookup-proto-get-err` (strict mode): Passed `lookup-proto-get-err`: starting `lookup-proto-get-err`: Passed `prop-desc` (strict mode): starting `prop-desc` (strict mode): Passed `prop-desc`: starting `prop-desc`: Passed `key-invalid` (strict mode): starting `key-invalid` (strict mode): Passed `key-invalid`: starting `key-invalid`: Passed `this-non-obj` (strict mode): starting `this-non-obj` (strict mode): Passed `this-non-obj`: starting `this-non-obj`: Passed Suite __lookupGetter__ results: total: 32, passed: 32, ignored: 0, failed: 0 (panics: 0), conformance: 100.00% Results: Total tests: 32 Passed tests: 32 Ignored tests: 0 Failed tests: 0 (panics: 0) Conformance: 100.00% ``` |
2 years ago |
cybai (Haku) | 220af1c375 |
Implement getter and setter of Object.prototype.__proto__ (#2110)
This Pull Request fixes part of #2067. It changes the following: - implemented getter of `Object.prototype.__proto__` - implemented setter of `Object.prototype.__proto__` I've tried to run tests with `test262/test/built-ins/Object/prototype/__proto__/` and all tests under that directory are pass now 🙏 <details> <summary>Toggle to see __proto__ test status</summary> ``` Compiling boa_engine v0.15.0 (/codespace/rust/boa/boa_engine) Compiling boa_tester v0.15.0 (/codespace/rust/boa/boa_tester) Finished release [optimized] target(s) in 2m 57s Running `target/release/boa_tester run -vv -d -s /codespace/rust/boa/test262/test/built-ins/Object/prototype/__proto__/` Loading the test suite... Test suite loaded, starting tests... Suite __proto__: `get-fn-name` (strict mode): starting `get-fn-name` (strict mode): Passed `get-fn-name`: starting `get-fn-name`: Passed `set-cycle-shadowed` (strict mode): starting `set-cycle-shadowed` (strict mode): Passed `set-cycle-shadowed`: starting `set-cycle-shadowed`: Passed `set-abrupt` (strict mode): starting `set-abrupt` (strict mode): Passed `set-abrupt`: starting `set-abrupt`: Passed `get-to-obj-abrupt` (strict mode): starting `get-to-obj-abrupt` (strict mode): Passed `get-to-obj-abrupt`: starting `get-to-obj-abrupt`: Passed `set-fn-name` (strict mode): starting `set-fn-name` (strict mode): Passed `set-fn-name`: starting `set-fn-name`: Passed `get-ordinary-obj` (strict mode): starting `get-ordinary-obj` (strict mode): Passed `get-ordinary-obj`: starting `get-ordinary-obj`: Passed `set-non-object` (strict mode): starting `set-non-object` (strict mode): Passed `set-non-object`: starting `set-non-object`: Passed `set-invalid-value` (strict mode): starting `set-invalid-value` (strict mode): Passed `set-invalid-value`: starting `set-invalid-value`: Passed `set-immutable` (strict mode): starting `set-immutable` (strict mode): Passed `set-immutable`: starting `set-immutable`: Passed `set-non-obj-coercible` (strict mode): starting `set-non-obj-coercible` (strict mode): Passed `set-non-obj-coercible`: starting `set-non-obj-coercible`: Passed `set-cycle` (strict mode): starting `set-cycle` (strict mode): Passed `set-cycle`: starting `set-cycle`: Passed `prop-desc` (strict mode): starting `prop-desc` (strict mode): Passed `prop-desc`: starting `prop-desc`: Passed `get-abrupt` (strict mode): starting `get-abrupt` (strict mode): Passed `get-abrupt`: starting `get-abrupt`: Passed `set-ordinary-obj` (strict mode): starting `set-ordinary-obj` (strict mode): Passed `set-ordinary-obj`: starting `set-ordinary-obj`: Passed `set-non-extensible` (strict mode): starting `set-non-extensible` (strict mode): Passed `set-non-extensible`: starting `set-non-extensible`: Passed Suite __proto__ results: total: 30, passed: 30, ignored: 0, failed: 0 (panics: 0), conformance: 100.00% Results: Total tests: 30 Passed tests: 30 Ignored tests: 0 Failed tests: 0 (panics: 0) Conformance: 100.00% ``` </details> |
2 years ago |
cybai (Haku) | 637ffcfd78 |
Fix spec links for some object operation methods (#2111)
It changes the following: Fix spec links for - `create_data_property` - `create_data_property_or_throw` - `delete_property_or_throw` |
2 years ago |
Ngo Iok Ui (Wu Yu Wei) | 0eb771d343 |
Implement `Object.prototype.__defineSetter__` (#2109)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel neccesary. ---> This Pull Request fixes part of https://github.com/boa-dev/boa/issues/2067. It adds the legacy `Object.prototype.__defineSetter__` function. |
2 years ago |
cybai (Haku) | b7e84d4c7d |
Implement `Object.prototype.__defineGetter__` (#2108)
This Pull Request fixes part of #2067. It introduces the legacy `Object.prototype.__defineGetter__` function. |
2 years ago |
raskad | 9025c36b1b |
Remove unnecessary `Trace` and `Finalize` implementations from AST (#2103)
This Pull Request fchanges the following: - Remove unnecessary `Trace` and `Finalize` implementations from AST - Add `#[unsafe_ignore_trace]` to parameters stored in `CodeBlock` - Remove unused `RcStatementList` type Relates to #1615 |
2 years ago |
Iban Eguia | 1dbd31e2b7 |
Added changelog, updated dependencies, bumped version number for 0.15 (#2102)
This Pull Request bumps the version number to 0.15, adds the changelog for this new versions and updates all dependencies to the latest versions. |
2 years ago |
raskad | ae01d5c20b |
Parse private generator methods in classes (#2092)
This Pull Request changes the following: - Parse private generator methods in classes |
2 years ago |
raskad | f0378068a0 |
Implement `Function` constructor (#2090)
This Pull Request changes the following: - Implement `Function` constructor - Ignore non-standard `caller` feature in 262 tests - Fix `Function.apply` length - Use `TypeError` in `Function.caller` and `Function.arguments` accessors |
2 years ago |
dependabot[bot] | 273beb4c33 |
Bump indexmap from 1.8.1 to 1.8.2 (#2094)
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.8.1 to 1.8.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bluss/indexmap/blob/1.8.2/RELEASES.rst">indexmap's changelog</a>.</em></p> <blockquote> <ul> <li> <p>1.8.2</p> <ul> <li>Bump the <code>rustc-rayon</code> dependency, for compiler use only.</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
jedel1043 | 518bad8109 |
Integrate ICU4X into `Intl` module (#2083)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel neccesary. ---> This Pull Request integrates an `ICU4X` data provider API in our codebase, to make use of the internationalization APIs that this crate provides. It changes the following: - Creates an API for pluggable icu data providers at `Context` creation, adding an `Icu` struct to store the provider (and some other internationalization tools) at runtime. - Slightly changes locale related functions to preserve the `Locale` type and ensure correctness. (Will make some other changes related to this). - Integrates the `sys_locale` crate to fetch the current default locale of an user instead of always returning `en-US`. |
2 years ago |
dependabot[bot] | c9391c1226 |
Bump once_cell from 1.11.0 to 1.12.0 (#2085)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.11.0 to 1.12.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.12.0</h2> <ul> <li>Add <code>OnceCell::wait</code>, a blocking variant of <code>get</code>.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
dependabot[bot] | 3b75c45dd6 |
Bump jemallocator from 0.3.2 to 0.5.0 (#2088)
Bumps [jemallocator](https://github.com/tikv/jemallocator) from 0.3.2 to 0.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tikv/jemallocator/releases">jemallocator's releases</a>.</em></p> <blockquote> <h2>0.4.3</h2> <ul> <li>Added riscv64 support (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/14">#14</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tikv/jemallocator/blob/main/CHANGELOG.md">jemallocator's changelog</a>.</em></p> <blockquote> <h1>0.5.0 - 2022-05-19</h1> <ul> <li>Update jemalloc to 5.3.0 (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/23">#23</a>)</li> </ul> <h1>0.4.3 - 2022-02-21</h1> <ul> <li>Added riscv64 support (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/14">#14</a>)</li> </ul> <h1>0.4.2 - 2021-08-09</h1> <ul> <li>Fixed prof not working under certain condition (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/9">#9</a>) (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/12">#12</a>)</li> <li>Updated paste to 1 (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/11">#11</a>)</li> </ul> <h1>0.4.1 - 2020-11-16</h1> <ul> <li>Updated jemalloc to fix deadlock during initialization</li> <li>Fixed failure of generating docs on release version</li> </ul> <h1>0.4.0 - 2020-07-21</h1> <ul> <li>Forked from jemallocator master</li> <li>Upgraded jemalloc to 5.2.1 (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/1">#1</a>)</li> <li>Fixed wrong version in generated C header (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/1">#1</a>)</li> <li>Upgraded project to 2018 edition (<a href="https://github-redirect.dependabot.com/tikv/jemallocator/issues/2">#2</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/tikv/jemallocator/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jemallocator&package-manager=cargo&previous-version=0.3.2&new-version=0.5.0)](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 |
raskad | 45dd2d416c |
Remove `strict` flag from `Context` (#2069)
The `Context` currently contains a `strict` flag that indicates is global strict mode is active. This is redundant to the strict flag that is set on every function and causes some non spec compliant situations. This pull request removes the strict flag from `Context` and fixes some resulting errors. Detailed changes: - Remove strict flag from `Context` - Make 262 tester compliant with the strict section in [test262/INTERPRETING.md]( |
3 years ago |