Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into wpt
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Jan 9, 2025
2 parents cf02e79 + ce6cfa8 commit 4062561
Show file tree
Hide file tree
Showing 271 changed files with 9,744 additions and 5,154 deletions.
50 changes: 20 additions & 30 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Nightly Build
permissions:
"contents": "write"

# Schedule this workflow to run at midnight every day
on:
Expand All @@ -8,38 +10,26 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Install Dependencies
run: |
cargo fetch
- name: Build Project
run: |
cargo build --release
- name: Set File Name
id: vars
run: |
DATE=$(date +'%Y%m%d')
COMMIT_HASH=$(git rev-parse --short HEAD)
echo "FILE_NAME=boa-nightly-linux-${DATE}-${COMMIT_HASH}" >> $GITHUB_ENV
- name: Rename Binary
run: mv target/release/boa target/release/$FILE_NAME

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
uses: taiki-e/upload-rust-binary-action@v1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/$FILE_NAME
asset_name: ${{ env.FILE_NAME }}
tag: nightly
overwrite: true
bin: boa
# We may be able to provide a custom archive name, but
# currently just going with the example default.
target: ${{ matrix.target }}
archive: $bin-$tag-$target
ref: refs/tags/nightly
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
# TODO: There seems to be an issue with the 1.83.0 toolchain and tarpaulin.
# See: https://github.com/xd009642/tarpaulin/issues/1642
toolchain: 1.82.0

- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -46,7 +48,7 @@ jobs:
run: cargo tarpaulin --workspace --features annex-b,intl_bundled,experimental --ignore-tests --engine llvm --out xml

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

tests:
name: Test
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/test262_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update Test262 Results on Release

on:
release:
types:
- published

jobs:
update_test262_results:
name: Update Test262 Results
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
# Checkout the main repository
- name: Checkout repository
uses: actions/checkout@v4
with:
path: boa

# Install Rust toolchain
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

# Cache cargo dependencies
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
target
~/.cargo/git
~/.cargo/registry
key: ${{ runner.os }}-cargo-test262-${{ hashFiles('**/Cargo.lock') }}

# Checkout the `data` repository
- name: Checkout the data repo
uses: actions/checkout@v4
with:
repository: boa-dev/data
token: ${{ secrets.GITHUB_TOKEN }}
path: data

# Run the Test262 test suite
- name: Run the test262 test suite
run: |
cd boa
cargo run --release --bin boa_tester -- run -v -o ../data/test262
# Commit and push results back to the `data` repo
- name: Commit and push results
run: |
cd data
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add test262/results/${{ github.ref_name }}
git commit -m "Update Test262 results for release ${{ github.ref_name }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 1 addition & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"program": "${workspaceFolder}/target/debug/boa_tester.exe"
},
"program": "${workspaceFolder}/target/debug/boa_tester",
"args": ["run", "-s", "${input:testPath}", "-vvv"],
"args": ["run", "-s", "${input:testPath}", "-vvv", "-d"],
"sourceLanguages": ["rust"],
"preLaunchTask": "Cargo Build boa_tester"
}
Expand All @@ -51,13 +51,11 @@
{
"id": "filePath",
"description": "Relative path to the file to run",
"default": "debug/script.js",
"type": "promptString"
},
{
"id": "modulePath",
"description": "Relative path to the module root directory",
"default": "debug",
"type": "promptString"
},
{
Expand Down
95 changes: 95 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,101 @@

## What's Changed

# [0.20.0 (2024-12-5)](https://github.com/boa-dev/boa/compare/v0.19.1...v0.20.0)

### Feature Enhancements

- Add a js_error! macro to create opaque errors by @hansl in https://github.com/boa-dev/boa/pull/3920
- Update `Instant` for new Temporal functionality by @nekevss in https://github.com/boa-dev/boa/pull/3928
- Add a way to add setters/getters in js_class! by @hansl in https://github.com/boa-dev/boa/pull/3911
- Fix lints from rustc 1.80.0 by @jedel1043 in https://github.com/boa-dev/boa/pull/3936
- Add a JsError::from_rust constructor to create native errors from Rust by @hansl in https://github.com/boa-dev/boa/pull/3921
- add some temporal methods by @jasonwilliams in https://github.com/boa-dev/boa/pull/3856
- Allow a custom Logger to be used as the backend for boa_runtime::Console by @hansl in https://github.com/boa-dev/boa/pull/3943
- Add more utility functions around modules and exports by @hansl in https://github.com/boa-dev/boa/pull/3937
- Allow trailing commas in js_class functions by @hansl in https://github.com/boa-dev/boa/pull/3964
- Implement `Atomics.pause` by @jedel1043 in https://github.com/boa-dev/boa/pull/3956
- Add a clone_inner method to allow cloning of inner data by @hansl in https://github.com/boa-dev/boa/pull/3968
- fix: ignore `debugger` statement by @shurizzle in https://github.com/boa-dev/boa/pull/3976
- Add support for boa(rename = "") in TryFromJs derive by @hansl in https://github.com/boa-dev/boa/pull/3980
- Add an "iter()" method to Js\*Array for convenience by @hansl in https://github.com/boa-dev/boa/pull/3986
- A simple module loader from a function by @hansl in https://github.com/boa-dev/boa/pull/3932
- Add a way for js_error! macro to create native errors with message by @hansl in https://github.com/boa-dev/boa/pull/3971
- Limit actions runs to 1 per branch and fix macos release by @jedel1043 in https://github.com/boa-dev/boa/pull/3996
- Add TextEncoder, TextDecoder implementations to boa_runtime by @hansl in https://github.com/boa-dev/boa/pull/3994
- Add TryFromJs for TypedJsFunction and more tests by @hansl in https://github.com/boa-dev/boa/pull/3981
- Add context to the console `Logger` trait by @hansl in https://github.com/boa-dev/boa/pull/4005
- Add a URL class to boa_runtime by @hansl in https://github.com/boa-dev/boa/pull/4004
- Add a display_lossy() to write a JsString lossily by @hansl in https://github.com/boa-dev/boa/pull/4023
- `TryIntoJs` trait and derive macro for it by @Nikita-str in https://github.com/boa-dev/boa/pull/3999
- console.debug() should use a debug Logger method by @hansl in https://github.com/boa-dev/boa/pull/4019
- `TryFromJs` from `JsMap` for `HashMap` & `BtreeMap` by @Nikita-str in https://github.com/boa-dev/boa/pull/3998
- Add string builder to build `JsString` by @CrazyboyQCD in https://github.com/boa-dev/boa/pull/3915

### Bug Fixes

- Implement `Math.pow` function according to ECMAScript specification by @magic-akari in https://github.com/boa-dev/boa/pull/3916
- Fix temporal builtin properties by @nekevss in https://github.com/boa-dev/boa/pull/3930
- Fix wrong `neg` operation by @CrazyboyQCD in https://github.com/boa-dev/boa/pull/3926
- Fix destructuring assignment evaluation order by @raskad in https://github.com/boa-dev/boa/pull/3934
- Fix various parser idempotency issues and parsing errors by @raskad in https://github.com/boa-dev/boa/pull/3917
- Implement new spec changes for `AsyncGenerator` by @jedel1043 in https://github.com/boa-dev/boa/pull/3950
- Refactor ast function types by @raskad in https://github.com/boa-dev/boa/pull/3931
- Fix `js_str` macro to correctly handle latin1 strings by @jedel1043 in https://github.com/boa-dev/boa/pull/3959
- Allow dead code for code that is newly detected as unused by @hansl in https://github.com/boa-dev/boa/pull/3984
- Allow warnings when running CI on release branches by @jedel1043 in https://github.com/boa-dev/boa/pull/3990
- docs: Fix link to examples by @it-a-me in https://github.com/boa-dev/boa/pull/4007
- `IntegerOrInfinity` `eq` bug fix by @Nikita-str in https://github.com/boa-dev/boa/pull/4010

### Internal Improvements

- Refactor `RawJsString`'s representation to make `JsString`s construction from string literal heap-allocation free by @CrazyboyQCD in https://github.com/boa-dev/boa/pull/3935
- Split default icu data into lazily deserialized parts by @jedel1043 in https://github.com/boa-dev/boa/pull/3948
- Add clippy for denying print and eprints by @hansl in https://github.com/boa-dev/boa/pull/3967
- Refactor iterator APIs to be on parity with the latest spec by @jedel1043 in https://github.com/boa-dev/boa/pull/3962
- Add support for Trace, Finalize and JsData for Convert<> by @hansl in https://github.com/boa-dev/boa/pull/3970
- use with_capacity to reduce re-allocations fixes #3896 by @jasonwilliams in https://github.com/boa-dev/boa/pull/3961
- add nightly build by @jasonwilliams in https://github.com/boa-dev/boa/pull/4026
- Patch the indentation in nightly_build.yml by @nekevss in https://github.com/boa-dev/boa/pull/4028
- Update night build's rename binary step by @nekevss in https://github.com/boa-dev/boa/pull/4032
- Use upload-rust-binary-action for nightly release by @nekevss in https://github.com/boa-dev/boa/pull/4040
- Fix `ref` value in nightly and add target to nightly release by @nekevss in https://github.com/boa-dev/boa/pull/4042
- Reduce environment allocations by @raskad in https://github.com/boa-dev/boa/pull/4002

### Other Changes

- Implement more Temporal functionality by @nekevss in https://github.com/boa-dev/boa/pull/3924
- Add a Source::with_path method to set the path on a Source by @hansl in https://github.com/boa-dev/boa/pull/3941
- Add spec edition 15 to the tester by @jedel1043 in https://github.com/boa-dev/boa/pull/3957
- Rename as_promise to as_promise_object and add as_promise -> JsPromise by @hansl in https://github.com/boa-dev/boa/pull/3965
- Build out partial record functionality, property bag construction, and `with` methods by @nekevss in https://github.com/boa-dev/boa/pull/3955
- Enable CI for release branches by @jedel1043 in https://github.com/boa-dev/boa/pull/3987
- Add a display type for JsString to allow formatting without allocations by @hansl in https://github.com/boa-dev/boa/pull/3951
- Add TryIntoJsResult for vectors by @hansl in https://github.com/boa-dev/boa/pull/3993
- Add tests from WPT and fix them in the Console by @hansl in https://github.com/boa-dev/boa/pull/3979
- Update changelog for v0.19.1 by @jedel1043 in https://github.com/boa-dev/boa/pull/3995
- Implement register allocation by @HalidOdat in https://github.com/boa-dev/boa/pull/3942
- Implement scope analysis and local variables by @raskad in https://github.com/boa-dev/boa/pull/3988
- `JsValue::to_json` fix integer property keys by @Nikita-str in https://github.com/boa-dev/boa/pull/4011
- Some optimizations on `Error` by @CrazyboyQCD in https://github.com/boa-dev/boa/pull/4020
- Option::None should try into Undefined, not Null by @hansl in https://github.com/boa-dev/boa/pull/4029
- Some string optimizations by @CrazyboyQCD in https://github.com/boa-dev/boa/pull/4030
- Add a JsPromise::from_result for convenience by @hansl in https://github.com/boa-dev/boa/pull/4039
- Fix misspelled permissions in nightly build action by @nekevss in https://github.com/boa-dev/boa/pull/4041
- Remove dockerfile from documentation by @4yman-0 in https://github.com/boa-dev/boa/pull/4046
- Bump dependencies with breaking changes by @jedel1043 in https://github.com/boa-dev/boa/pull/4050
- Migrate to fast-float2 by @jedel1043 in https://github.com/boa-dev/boa/pull/4052

## New Contributors

- @magic-akari made their first contribution in https://github.com/boa-dev/boa/pull/3916
- @shurizzle made their first contribution in https://github.com/boa-dev/boa/pull/3976
- @it-a-me made their first contribution in https://github.com/boa-dev/boa/pull/4007
- @Nikita-str made their first contribution in https://github.com/boa-dev/boa/pull/4010
- @4yman-0 made their first contribution in https://github.com/boa-dev/boa/pull/4046

**Full Changelog**: https://github.com/boa-dev/boa/compare/v0.19...v0.20.0

# [0.19.1 (2024-09-11)](https://github.com/boa-dev/boa/compare/v0.19...v0.19.1)

### Bug Fixes
Expand Down
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ There are some pre-defined tasks in [tasks.json](.vscode/tasks.json)
- Test - (there is no shortcut, you'll need to make one) - Runs `Cargo Test`.
I personally set a shortcut of shift+cmd+option+T (or shift+ctrl+alt+T)

If you don't want to install everything on your machine, you can use the Dockerfile.
Start VSCode in container mode (you may need the docker container plugin) and use the Dockerfile.

## Testing

Boa provides its own test suite, and can also run the official ECMAScript test suite. To run the Boa test
Expand Down
Loading

0 comments on commit 4062561

Please sign in to comment.