mirror of https://github.com/boa-dev/boa.git
Tree:
5b46d1275c
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 }
1586 Commits (5b46d1275c7abab317a5d3d96024beb838fa6ac6)
Author | SHA1 | Message | Date |
---|---|---|---|
Halid Odat | a9a82a7381 |
Make iterator spec complaint (#1889)
This PR is also related to #577 Changes: - Implements `IteratorValue` (`IteratorResult::value()`) - Implements `IteratorComplete` (`IteratorResult::complete()`) - Implements `IteratorStep` (`IteratorRecord::step()`) - Makes `IteratorNext` (`IteratorRecord::next()`) spec compliant - Deprecates/removes `JsValue::get_field()`. |
3 years ago |
jedel1043 | 00a19005e4 |
Remove `toInteger` and document the `string` builtin (#1884)
The ECMAScript 2022 specification removes the `toInteger` method, and replaces it with `toIntegerOrInfinity`, which is arguably better for us since the `JsValue::toInteger` returns an `f64`, which is pretty confusing at times. This pull request removes the `JsValue::to_integer` method, replaces all its calls by `JsValue::to_integer_or_infinity` or others per the spec and documents several methods from the `string` builtin. |
3 years ago |
Halid Odat | fd889fd5d0 |
Fix `PropertyKey` to `JsValue` conversion (#1886)
We store string `PropertyKey`s with two enums `String` and `Index` for performance reasons, but the spec does not differentiate between string and index property keys so before conversion to `JsValue` we have to convert to a string. This was failing tests like `Reflect.ownKeys([true, "", 1])` because it was returning (integer numbers) `[1, 2, 3]` instead of `['1', '2', '3']` |
3 years ago |
Halid Odat | 7248ed1005 |
Make `StringToNumber` spec compliant (#1881)
This PR enables `StringToNumber()` to parse binary, octal and hexadecimal numbers. |
3 years ago |
Halid Odat | 3c59905a1b |
`%NativeError%.[[prototype]]` should be `Error` constructor (#1883)
Before the `%NativeError%` objects (like `TypeError`, `ReferenceError`, etc) `[[prototype]]` field was set to `Function.prototype` but this is wrong it should be the `Error` constructor object itself. This makes the `%NativeError%`s 100% spec compliant :) (except `AggregateError` because its not implemented) |
3 years ago |
raskad | 408e49e460 |
Cleanup vm stack on function return (#1880)
This cleans up the vm stack on a function return. This is needed because when errors are thrown, there may be still values on the stack that cannot be cleaned up via regular control flow. The change should have little performance impact, because the `Vec::truncate` function does not alter the capacity of the vector. |
3 years ago |
Jason Williams |
b2d3720b29
|
Update release.yml
The casing needs updating on the Internal label |
3 years ago |
Halid Odat | 6e3f93e632 |
Fix `Number.prototype.toString` when passing `undefined` as radix (#1877)
This PR fixes the bug when passing `undefined` as radix in `Number.prototype.toString()` which was throwing a range error, instead of setting the radix to `10` [spec](https://tc39.es/ecma262/#sec-number.prototype.tostring): > **Note** > > The optional radix should be an [integral Number](https://tc39.es/ecma262/#integral-number) value in the inclusive range 2𝔽 to 36𝔽. If radix is undefined then 10𝔽 is used as the value of radix. |
3 years ago |
Halid Odat | 3fe7d09096 |
Make `Error` and `%NativeError%` spec compliant (#1879)
This PR makes `Error` and `%NativeError%` spec compliant. It changes the following: - Adds cause argument object. - Makes `message` non-enumerable. |
3 years ago |
dependabot[bot] | d7ed2fe5c9 |
Bump git2 from 0.14.0 to 0.14.1 (#1878)
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.14.0 to 0.14.1. <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Halid Odat | 4292c193fa |
Implement `Object.prototype.toLocaleString()` (#1875)
It changes the following: - Implement `Object.prototype.toLocaleString()` |
3 years ago |
Halid Odat | 73bcd42640 |
Make `Object.getOwnPropertyDescriptors` spec compliant (#1876)
It changes the following: - Fix `Object.getOwnPropertyDescriptors()` to comply to spec |
3 years ago |
Iban Eguia | ec78e184f3 |
Removed reference counted pointers from `JsValue` variants (#1866)
This Pull Request fixes/closes #1864. It changes the following: - Removed `JsBigInt` from `Const` nodes, using a boxed `BigInt` instead. - Modifies the `JsObject` variant so that it has a similar structure to other variants, where the internal structure is private. The size of `JsValue` stays in 2 64-bit words (in a 64-bit system at least), and the size of `Const` also stays the same. I have noticed that we clone tokens too much in the parser, so I was thinking that we should implement a by-value getter for `kind()`. Something like `kind_unwrap()`. |
3 years ago |
Iban Eguia | 1887b6aebb |
Removing the panic in favour of an error result (#1874)
This Pull Request is related to #1873. It changes the following: - Removes the panic in case a label is not found. I think this should be an early syntax error, but at least we shouldn't panic while we fix the issue with the labels. I think we should solve the issue with labeled statements for 0.15. |
3 years ago |
Halid Odat | ada4ca895f |
Feature arrays with empty elements (#1870)
This PR adds support for arrays with empty elements e.g. `["", false, , , ]`. Before we were filling the empty places with `undefined`, but this is wrong according to [spec](https://tc39.es/ecma262/#sec-runtime-semantics-arrayaccumulation) there shouldn't be undefined with a index at that place, instead only `length` is incremented. So `[,,,].length == 3` and operations like `[,,,,].indexOf(undefined) == -1`, `[,,,,].lastIndexOf(undefined) == -1` etc. |
3 years ago |
Halid Odat | 6b2ca30946 |
Fix equality between objects and `undefined` or `null` (#1872)
This PR fixes equality between object and `null` or `undefined` (like `[] == null`), which was failing the test262 harness test [`compare-array-symbol.js`](
|
3 years ago |
raskad | 60e2294706 |
Implement generator execution (#1790)
This Pull Request fixes/closes #1559. It changes the following: - Implement GeneratorFunction Objects - Implement Generator Objects - Implement generator execution in vm - Create `FormalParameterList` to remove duplicate checks on function parameters - Refactor `MethodDefinition` on object literals |
3 years ago |
dependabot[bot] | f7fab0744c |
Bump git2 from 0.13.25 to 0.14.0 (#1869)
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.13.25 to 0.14.0. <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
dependabot[bot] | 7aa001ae8f |
Update git2 requirement from 0.13.25 to 0.14.0 in /boa_tester (#1868)
Updates the requirements on [git2](https://github.com/rust-lang/git2-rs) to permit the latest version. <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Halid Odat | b5678f0b0c |
Removing internal deprecated functions (#1854)
This Pull Request is related to #577 . It changes the following: - Remove `JsValue::set_field` - Remove `JsValue::set_property` - Remove almost all uses of `JsValue::get_field` - Use `.get_v()` instead of `get_field` according to spec in `serialize_json_property` - Remove `Array::new_array()` - Remove `Array::add_to_array_object()` |
3 years ago |
João Borges | 6093a66899 |
Refactorings for Rust 1.59 (#1867)
This Pull Request fixes new lint errors and warnings introduced in rust 1.59 Each commit describes its changse. Co-authored-by: raskad <32105367+raskad@users.noreply.github.com> |
3 years ago |
Halid Odat | 9dda8d3eae |
Toggleable `JsValue` internals displaying (#1865)
This PR makes `JsValue` (object) only display owned properties, cleans up object printing. This can be toggled with `value.display().internals(true)` `>> ({x: 1, y: ""})` _Before:_ <details> <pre> { x: 1, y: "", __proto__: { hasOwnProperty: { length: 1, name: "hasOwnProperty", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, propertyIsEnumerable: { length: 1, name: "propertyIsEnumerable", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, toString: { length: 0, name: "toString", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, valueOf: { length: 0, name: "valueOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isPrototypeOf: { length: 1, name: "isPrototypeOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, constructor: { create: { length: 2, name: "create", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, setPrototypeOf: { length: 2, name: "setPrototypeOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getPrototypeOf: { length: 1, name: "getPrototypeOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, defineProperty: { length: 3, name: "defineProperty", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, defineProperties: { length: 2, name: "defineProperties", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, assign: { length: 2, name: "assign", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, is: { length: 2, name: "is", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, keys: { length: 1, name: "keys", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, values: { length: 1, name: "values", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, entries: { length: 1, name: "entries", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, seal: { length: 1, name: "seal", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isSealed: { length: 1, name: "isSealed", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, freeze: { length: 1, name: "freeze", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isFrozen: { length: 1, name: "isFrozen", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, preventExtensions: { length: 1, name: "preventExtensions", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isExtensible: { length: 1, name: "isExtensible", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertyDescriptor: { length: 2, name: "getOwnPropertyDescriptor", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertyDescriptors: { length: 1, name: "getOwnPropertyDescriptors", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertyNames: { length: 1, name: "getOwnPropertyNames", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertySymbols: { length: 1, name: "getOwnPropertySymbols", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, hasOwn: { length: 2, name: "hasOwn", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, fromEntries: { length: 1, name: "fromEntries", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, length: 1, name: "Object", prototype: [Cycle], __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, __proto__: null } } </pre> </details> _After:_ ```text { x: 1, y: "" } ``` |
3 years ago |
Addison Crump | 2c19c6a4b5 |
Correct pop_on_return behaviour (#1853)
This PR changes the following: - Updates the value of `pop_on_return` after a catch as to prevent VM stack corruption - Adds two test cases which demonstrate the issue and demonstrate that it has been fixed I am unsure if it is possible to abuse the patch provided; one would need to catch from within an array initialisation without calling into another frame (e.g., with a lambda), which I don't think is possible. |
3 years ago |
dependabot[bot] | d07945ddf3 |
Bump getrandom from 0.2.4 to 0.2.5 (#1863)
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.4 to 0.2.5. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md">getrandom's changelog</a>.</em></p> <blockquote> <h2>[0.2.5] - 2022-02-22</h2> <h3>Added</h3> <ul> <li>ESP-IDF targets (<code>*‑espidf</code>) support <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/245">#245</a></li> </ul> <h3>Fixed</h3> <ul> <li>Webpack warning caused by dynamic require <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/234">#234</a></li> <li>Error checking on iOS for <code>SecRandomCopyBytes</code> <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/244">#244</a></li> </ul> <p><a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/234">#234</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/234">rust-random/getrandom#234</a> <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/244">#244</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/244">rust-random/getrandom#244</a> <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/245">#245</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/245">rust-random/getrandom#245</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
dependabot[bot] | 8ffae90400 |
Bump boa-dev/criterion-compare-action from 3.1.0 to 3.2.0 (#1862)
Bumps [boa-dev/criterion-compare-action](https://github.com/boa-dev/criterion-compare-action) from 3.1.0 to 3.2.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/boa-dev/criterion-compare-action/releases">boa-dev/criterion-compare-action's releases</a>.</em></p> <blockquote> <h2>v3.2.0</h2> <p>This release adds support for the <code>--no-default-features</code> tag.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Iban Eguia | 8c92a8fa25 |
Added conversions from and to serde_json's Value type (#1851)
This Pull Request closes #1693. It changes the following: - It adds a fallible conversion from `serde_json::Value` to `JsValue`, which requires a context. - It adds a fallible conversion from `JsValue` to `serde_json::Value`, which requires a context. - Added examples to the documentation of both methods. - Removed some duplicate and non-needed code that I found while doing this. Co-authored-by: RageKnify <RageKnify@gmail.com> |
3 years ago |
Iban Eguia | 0a2c60a9aa |
Fixed dependabot for submodule (#1856)
This Pull Request fixes dependabot updates for the Test262 submodule. |
3 years ago |
dependabot[bot] | 2c6acebe6c |
Bump test262 from `281c781` to `18ce639` (#1857)
Bumps [test262](https://github.com/tc39/test262) from `281c781` to `18ce639`. <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Iban Eguia | ab4d2899d5 |
Fixing main branch workflows (#1858)
It seems that the workflow in the `main` branch is failing to push benchmark results, so I think this should fix it, let's see. |
3 years ago |
Iban Eguia |
4d2772d6a0
|
Rename "Boa" to boa_engine, moved GC and profiler to their crates (#1844)
* Separated GC and Profiler * Fixed prettierignore * Removed re-exports, fixed benchmarks, added some caches * Removed empty line * Update boa_engine/Cargo.toml Co-authored-by: raskad <32105367+raskad@users.noreply.github.com> * Fixed the profiler * Removed empty file Co-authored-by: raskad <32105367+raskad@users.noreply.github.com> |
3 years ago |
Aäron Munsters | 517c6724c9 |
Correct reference error message (#1855)
This Pull Request fixes/closes the incorrect message thrown for the following code: ```javascript "use strict"; foo = "bar"; ``` Which would throw the following before the change (incorrect): `Uncaught "ReferenceError": "binding already exists: foo"` And would throw the following after the change (correct): `Uncaught "ReferenceError": "assignment to undeclared variable foo"` |
3 years ago |
Addison Crump | 1d2851465f |
Add assertion to check that a break label is identified at compile-time (#1852)
This PR changes the following: - Adds a check at compile time for the existence of a break label (this should be a syntax error in the future; refactor from panics to results in compile should be a separate PR) - Adds a test for break label existence in boa/tests 262 misses some fairly important JS parity issues and not performing this check eagerly can lead to other more severe issues during VM execution. |
3 years ago |
Halid Odat | 9f6aa1972c |
Feature `JsArray` (#1746)
This PR introduces a new API for JavaScript builtin objects in Rust (such as `Array`, `Map`, `Proxy`, etc). Rather than just expose the raw builtin functions as discussed here #1692 (though having raw API exposed may be nice as well), In this PR we introduce a very light wrapper around the raw API, for a more pleasant user experience. The wrapper implements functions that are specific to the wrapper type (for `Array` this would be methods like `pop`, `push`, etc) as well as implementing `Deref<Target = JsObject>` so we can call `JsObject` functions without converting to `JsObject` and `Into<JsValue>` for easy to `JsValue` conversions. Please check `jsarray.rs` in the `examples` |
3 years ago |
raskad | 1d6e14763b |
Refactor mapped `Arguments` object (#1849)
This refactors the representation of the `[[ParameterMap]]` internal slot on the `Arguments` exotic object to be faster at runtime. Previously `[[ParameterMap]]` was a `JsObject` like the spec describes. This can be pretty slow a runtime, because the argument getters and setters must be represented as function objects on the `[[ParameterMap]]` object. In addition to the time spend on creation and calling of those functions, every getter/setter needs a cloned gc reference to the function environment to access the bindings. This adds to the gc overhead. The spec states that the `[[ParameterMap]]` internal slot doesn't have to be a `JsObject`. See NOTE 3 here: https://tc39.es/ecma262/#sec-arguments-exotic-objects Leveraging this freedom, we can use a more optimized representation, that avoids any `JsObject` usage and only needs one clone of the function environment. |
3 years ago |
Iban Eguia | 46f96d4bea |
Fix wasm use outside browsers (#1846)
This Pull Request fixes/closes #1670. It changes the following: - Removes the "js" feature by default from getrandom for wasm (still there for boa_wasm) - Updates dependencies Note that this change was introduced in #1521, after #1475. We must make sure that the issue doesn't come back. |
3 years ago |
Timo | fabbf15dd3 |
Handle allocation errors (#1850)
Fixes #1847 by wrapping the `std::alloc::alloc()` call in `try_alloc()`, which checks that the returned pointer is non-null and handles allocation errors that way. It will now abort the process instead of executing UB in the error path |
3 years ago |
raskad | 29cd909f88 |
Refactor the environment for runtime performance (#1829)
This is an attempt to refactor the environments to be more performant at runtime. The idea is, to shift the dynamic hashmap environment lookups from runtime to compile time. Currently the environments hold hashmaps that contain binding identifiers, values and additional information that is needed to identify some errors. Because bindings in outer environments are accessible from inner environments, this can lead to a traversal through all environments (in the worst case to the global environment). This change to the environment structure pushes most of the work that is needed to access bindings to the compile time. At compile time, environments and bindings in the environments are being assigned indices. These indices are then stored instead of the `Sym` that is currently used to access bindings. At runtime, the indices are used to access bindings in a fixed size `Vec` per environment. This brings multiple benefits: - No hashmap access needed at runtime - The number of bindings per environment is known at compile time. Environments only need a single allocation, as their size is constant. - Potential for optimizations with `unsafe` https://doc.rust-lang.org/std/vec/struct.Vec.html#method.get_unchecked Additionally, this changes the global object to have it's bindings directly stored on the `Realm`. This should reduce some overhead from access trough gc objects and makes some optimizations for the global object possible. The benchmarks look not that great on the first sight. But if you look closer, I think it is apparent, that this is a positive change. The difference is most apparent on Mini and Clean as they are longer (still not near any real life js but less specific that most other benchmarks): | Test | Base | PR | % | |------|--------------|------------------|---| | Clean js (Compiler) | **1929.1±5.37ns** | 4.1±0.02µs | **+112.53%** | | Clean js (Execution) | 1487.4±7.50µs | **987.3±3.78µs** | **-33.62%** | The compile time is up in all benchmarks, as expected. The percentage is huge, but if we look at the real numbers, we can see that this is an issue of orders of magnitude. While compile is up `112.53%`, the real change is `~+2µs`. Execution is only down `33.62%`, but the real time changed by `~-500µs`. Co-authored-by: Iban Eguia <razican@protonmail.ch> |
3 years ago |
dependabot[bot] | e800283552 |
Bump benchmark-action/github-action-benchmark from 1.12.0 to 1.13.0 (#1845)
Bumps [benchmark-action/github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) from 1.12.0 to 1.13.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/benchmark-action/github-action-benchmark/releases">benchmark-action/github-action-benchmark's releases</a>.</em></p>
<blockquote>
<h2>v1.13.0</h2>
<p>Feat: Updated urls to support GHES (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/104">#104</a>)
Feat: Add support for BenchmarkDotNet (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/109">#109</a>)
Chore: Bump node-fetch from 2.6.6 to 2.6.7 (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/107">#107</a>)</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/benchmark-action/github-action-benchmark/blob/master/CHANGELOG.md">benchmark-action/github-action-benchmark's changelog</a>.</em></p>
<blockquote>
<h1><a href="https://github.com/benchmark-action/github-action-benchmark/releases/tag/v1.13.0">v1.13.0</a> - 17 Feb 2022</h1>
<ul>
<li><strong>Feat:</strong> Updated urls to support GHES (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/104">#104</a>)</li>
<li><strong>Feat:</strong> Add support for BenchmarkDotNet (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/109">#109</a>)</li>
<li><strong>Chore</strong> Bump node-fetch from 2.6.6 to 2.6.7 (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/107">#107</a>)</li>
</ul>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="
|
3 years ago |
dependabot[bot] | 4a33d20c71 |
Bump webpack from 5.69.0 to 5.69.1 (#1843)
Bumps [webpack](https://github.com/webpack/webpack) from 5.69.0 to 5.69.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/webpack/webpack/releases">webpack's releases</a>.</em></p> <blockquote> <h2>v5.69.1</h2> <h1>Revert</h1> <ul> <li>revert "handle multiple alternative directories (e. g. due to resolve.alias or resolve.modules) when creating an context module"</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Iban Eguia | 748465d17b |
Unwrap removal (#1842)
This removes all the calls to `unwrap()` in the codebase, which made me found a couple of places where it wasn't needed, and could be improved. I also noticed we don't have dependabot updates for the test262 submodule and the interner dependencies, so I added those. I added lints so that no new unwraps are added. |
3 years ago |
dependabot[bot] | 3d9c8b229d |
Bump serde_json from 1.0.78 to 1.0.79 (#1838)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.78 to 1.0.79. <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.79</h2> <ul> <li>Allow <code>RawValue</code> deserialization to propagate <code>\u</code> escapes for unmatched surrogates, which can later by deserialized to Vec<u8> (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/830">#830</a>, thanks <a href="https://github.com/lucacasonato"><code>@lucacasonato</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
raskad | 51537badc3 |
Ignore wastefull `RegExp` tests (#1840)
With the implementation of `String.fromCodePoint` in #1123 some `RegExp` tests are now running for a long time. These tests check every unicode codepoint for all regexp property escape/character classes. This not only makes the developer experience significantly worse, but also wastes cpu resources for the benefit of "completeness". I think these tests are completely useless. Ironically the unicode tables in the tests are generated - from the same data, that the unicode tables in the regex engine are also generated. 262 suite runtime: Before: ~03:30 https://github.com/boa-dev/boa/runs/5191567446?check_suite_focus=true After: ~31:00 https://github.com/boa-dev/boa/runs/5196405437?check_suite_focus=true |
3 years ago |
Aäron Munsters | 826adb2009 |
Rework RegExp struct to include bitflags field (#1837)
This Pull Request fixes/closes #1819. It changes the following: - Move the bitflags from `boa/src/syntax/lexer/regex.rs` to `boa/src/builtins/regexp/mod.rs` - Replace the booleans in the RegExp struct to include the bitflags struct - Update match expressions to make use of the bitflags struct Co-authored-by: Aäron Munsters <45006406+aaronmunsters@users.noreply.github.com> |
3 years ago |
dependabot[bot] | 7716c53fa6 |
Bump rand from 0.8.4 to 0.8.5 (#1839)
Bumps [rand](https://github.com/rust-random/rand) from 0.8.4 to 0.8.5. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-random/rand/blob/master/CHANGELOG.md">rand's changelog</a>.</em></p> <blockquote> <h2>[0.8.5] - 2021-08-20</h2> <h3>Fixes</h3> <ul> <li>Fix build on non-32/64-bit architectures (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1144">#1144</a>)</li> <li>Fix "min_const_gen" feature for <code>no_std</code> (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1173">#1173</a>)</li> <li>Check <code>libc::pthread_atfork</code> return value with panic on error (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1178">#1178</a>)</li> <li>More robust reseeding in case <code>ReseedingRng</code> is used from a fork handler (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1178">#1178</a>)</li> <li>Fix nightly: remove unused <code>slice_partition_at_index</code> feature (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1215">#1215</a>)</li> <li>Fix nightly + <code>simd_support</code>: update <code>packed_simd</code> (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1216">#1216</a>)</li> </ul> <h3>Rngs</h3> <ul> <li><code>StdRng</code>: Switch from HC128 to ChaCha12 on emscripten (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1142">#1142</a>). We now use ChaCha12 on all platforms.</li> </ul> <h3>Documentation</h3> <ul> <li>Added docs about rand's use of const generics (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1150">#1150</a>)</li> <li>Better random chars example (<a href="https://github-redirect.dependabot.com/rust-random/rand/issues/1157">#1157</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
dependabot[bot] | 6db813f055 |
Bump webpack from 5.68.0 to 5.69.0 (#1841)
Bumps [webpack](https://github.com/webpack/webpack) from 5.68.0 to 5.69.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/webpack/webpack/releases">webpack's releases</a>.</em></p> <blockquote> <h2>v5.69.0</h2> <h1>Features</h1> <ul> <li>automatically switch to an ESM compatible environment when enabling ESM output mode</li> <li>handle multiple alternative directories (e. g. due to <code>resolve.alias</code> or <code>resolve.modules</code>) when creating an context module</li> <li>add <code>util/types</code> to node.js built-in modules</li> <li>add <code>__webpack_exports_info__.<name>.canMangle</code> api</li> </ul> <h1>Bugfixes</h1> <ul> <li>fix bug in chunk graph generation which leads to modules being included in chunk desprite them being already included in parent chunks</li> <li>avoid writing more than 2GB at once during cache serialization (as workaround for node.js/libuv bug on MacOS)</li> <li>fix handling of whitespaces in semver ranges when using Module Federation</li> <li>avoid generating hashes which contain only numbers as they likely conflict with module ids</li> <li>fix resource name based placeholders for data uris</li> <li>fix cache serialization for context elements</li> <li>fix passing of <code>stage</code> option when instrumenting plugins for the ProfilingPlugin</li> <li>fix tracking of declarations in concatenated modules to avoid conflicts</li> <li>fix unstable mangling of exports</li> <li>fix handling of <code>#</code> in paths of loaders</li> <li>avoid unnecessary cache update when using <code>experiments.buildHttp</code></li> </ul> <h1>Contributing</h1> <ul> <li>update typescript and jest</li> </ul> <h1>Developer Experience</h1> <ul> <li>expose some additional typings for usage in webpack-cli</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Jevan Chan | be26b10ea8 |
Fix string.prototype methods and add static string methods (#1123)
<!--- 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 existing string prototype methods in #13 and adds static methods. It changes the following: - Fix bugs in existing string prototype methods and improve readability (e.g. rename variables to match the names in spec) - Add static methods `String.raw`, `String.fromCharCode`, `String.fromCodePoint` - Fix broken unit tests Co-authored-by: RageKnify <RageKnify@gmail.com> |
3 years ago |
Djordje Lukic | 7e772768e2 |
Give the arrow function its proper name (#1832)
With this change an arrow function name is correctly set to the name of the variable: ```javascript const myFunction = () => {}; console.log(myFunction.name); // Prints "myFunction" ``` _Note:_ I'm still getting familiar with the codebase and am pretty new to Rust so I won't be offended if this isn't merged. I am actually surprised I had to make so many changes to give the right code the name it needed. Maybe there is a better way? I'm all ears :) |
3 years ago |
Iban Eguia | 53ef07b1a6 |
Using the new formatting arguments from Rust 1.58 (#1834)
In [Rust 1.58](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html#captured-identifiers-in-format-strings), capturing of bindings were added to format strings. This makes things more clear, so I added this where possible. |
3 years ago |
dependabot[bot] | 7b2dc881a0 |
Bump follow-redirects from 1.14.7 to 1.14.8 (#1833)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
dependabot[bot] | 7779c1a6f1 |
Bump boa-dev/criterion-compare-action from 3.0.2 to 3.1.0 (#1827)
Bumps [boa-dev/criterion-compare-action](https://github.com/boa-dev/criterion-compare-action) from 3.0.2 to 3.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/boa-dev/criterion-compare-action/releases">boa-dev/criterion-compare-action's releases</a>.</em></p> <blockquote> <h2>v3.1.0</h2> <p>Added the possibility to add feature flags for a benchmark (<a href="https://github-redirect.dependabot.com/boa-dev/criterion-compare-action/pull/32">boa-dev/criterion-compare-action#32</a>)</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |