mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
chore: upgrade rusty_v8 to 0.71.0 (#18868)
This commit is contained in:
parent
c3d670dbc9
commit
6cd62ea5e9
11 changed files with 48 additions and 140 deletions
4
.github/workflows/ci.generate.ts
vendored
4
.github/workflows/ci.generate.ts
vendored
|
@ -17,7 +17,7 @@ const Runners = (() => {
|
|||
})();
|
||||
// bump the number at the start when you want to purge the cache
|
||||
const prCacheKeyPrefix =
|
||||
"22-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-";
|
||||
"23-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-";
|
||||
|
||||
const installPkgsCommand =
|
||||
"sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15";
|
||||
|
@ -476,7 +476,7 @@ const ci = {
|
|||
"~/.cargo/git/db",
|
||||
].join("\n"),
|
||||
key:
|
||||
"22-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}",
|
||||
"23-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -290,7 +290,7 @@ jobs:
|
|||
~/.cargo/registry/index
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git/db
|
||||
key: '22-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
|
||||
key: '23-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
|
||||
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
|
||||
- name: Restore cache build output (PR)
|
||||
uses: actions/cache/restore@v3
|
||||
|
@ -302,7 +302,7 @@ jobs:
|
|||
!./target/*/*.zip
|
||||
!./target/*/*.tar.gz
|
||||
key: never_saved
|
||||
restore-keys: '22-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
|
||||
restore-keys: '23-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
|
||||
- name: Apply and update mtime cache
|
||||
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (!startsWith(github.ref, ''refs/tags/''))'
|
||||
uses: ./.github/mtime_cache
|
||||
|
@ -578,7 +578,7 @@ jobs:
|
|||
!./target/*/gn_out
|
||||
!./target/*/*.zip
|
||||
!./target/*/*.tar.gz
|
||||
key: '22-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
|
||||
key: '23-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
|
||||
publish-canary:
|
||||
name: publish canary
|
||||
runs-on: ubuntu-22.04
|
||||
|
|
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -5678,9 +5678,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "v8"
|
||||
version = "0.70.0"
|
||||
version = "0.71.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab13e022340b67561836bbb90ceeebbfca7e35fbc05471ceff5ce099e5a754a3"
|
||||
checksum = "51a173a437bebab13d587a4aaf0a1e7a49433226538c9a78ca3b4ce3b8c6aeb6"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"fslock",
|
||||
|
|
|
@ -41,7 +41,7 @@ license = "MIT"
|
|||
repository = "https://github.com/denoland/deno"
|
||||
|
||||
[workspace.dependencies]
|
||||
v8 = { version = "0.70.0", default-features = false }
|
||||
v8 = { version = "0.71.0", default-features = false }
|
||||
deno_ast = { version = "0.26.0", features = ["transpiling"] }
|
||||
|
||||
deno_core = { version = "0.181.0", path = "./core" }
|
||||
|
|
|
@ -3,4 +3,8 @@ error: Uncaught Error: bar
|
|||
throw new Error("bar");
|
||||
^
|
||||
at [WILDCARD]/event_listener_error_immediate_exit.ts:4:9[WILDCARD]
|
||||
at innerInvokeEventListeners (ext:deno_web/02_event.js:785:7)
|
||||
at invokeEventListeners (ext:deno_web/02_event.js:825:5)
|
||||
at dispatch (ext:deno_web/02_event.js:694:9)
|
||||
at dispatchEvent (ext:deno_web/02_event.js:1086:12)
|
||||
at [WILDCARD]/event_listener_error_immediate_exit.ts:11:1
|
||||
|
|
|
@ -3,6 +3,10 @@ error: Uncaught (in worker "") Error: bar
|
|||
throw new Error("bar");
|
||||
^
|
||||
at [WILDCARD]/event_listener_error_immediate_exit.ts:4:9
|
||||
at innerInvokeEventListeners (ext:deno_web/02_event.js:785:7)
|
||||
at invokeEventListeners (ext:deno_web/02_event.js:825:5)
|
||||
at dispatch (ext:deno_web/02_event.js:694:9)
|
||||
at dispatchEvent (ext:deno_web/02_event.js:1086:12)
|
||||
at [WILDCARD]/event_listener_error_immediate_exit.ts:11:1
|
||||
error: Uncaught (in promise) Error: Unhandled error in child worker.
|
||||
at [WILDCARD]
|
||||
|
|
|
@ -196,7 +196,6 @@ fn v8_init(
|
|||
" --no-validate-asm",
|
||||
" --turbo_fast_api_calls",
|
||||
" --harmony-change-array-by-copy",
|
||||
" --no-harmony-rab-gsab",
|
||||
);
|
||||
|
||||
if predictable {
|
||||
|
@ -1527,6 +1526,10 @@ pub(crate) fn exception_to_err_result<T>(
|
|||
let state_rc = JsRuntime::state(scope);
|
||||
|
||||
let was_terminating_execution = scope.is_execution_terminating();
|
||||
// Disable running microtasks for a moment. When upgrading to V8 v11.4
|
||||
// we discovered that canceling termination here will cause the queued
|
||||
// microtasks to run which breaks some tests.
|
||||
scope.set_microtasks_policy(v8::MicrotasksPolicy::Explicit);
|
||||
// If TerminateExecution was called, cancel isolate termination so that the
|
||||
// exception can be created. Note that `scope.is_execution_terminating()` may
|
||||
// have returned false if TerminateExecution was indeed called but there was
|
||||
|
@ -1560,6 +1563,7 @@ pub(crate) fn exception_to_err_result<T>(
|
|||
// Resume exception termination.
|
||||
scope.terminate_execution();
|
||||
}
|
||||
scope.set_microtasks_policy(v8::MicrotasksPolicy::Auto);
|
||||
|
||||
Err(js_error.into())
|
||||
}
|
||||
|
@ -4737,25 +4741,6 @@ Deno.core.opAsync("op_async_serialize_object_with_numbers_as_keys", {
|
|||
.is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_resizable_array_buffer() {
|
||||
// Verify that "resizable ArrayBuffer" is disabled
|
||||
let mut runtime = JsRuntime::new(Default::default());
|
||||
runtime
|
||||
.execute_script_static(
|
||||
"test_rab.js",
|
||||
r#"const a = new ArrayBuffer(100, {maxByteLength: 200});
|
||||
if (a.byteLength !== 100) {
|
||||
throw new Error('wrong byte length');
|
||||
}
|
||||
if (a.maxByteLength !== undefined) {
|
||||
throw new Error("ArrayBuffer shouldn't have maxByteLength");
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_non_existent_async_op_error() {
|
||||
// Verify that "resizable ArrayBuffer" is disabled
|
||||
|
|
|
@ -55,6 +55,9 @@ pub enum Error {
|
|||
|
||||
#[error("serde_v8 error: length mismatch, got: {0}, expected: {1}")]
|
||||
LengthMismatch(usize, usize),
|
||||
|
||||
#[error("serde_v8 error: can't create slice from resizable ArrayBuffer")]
|
||||
ResizableBackingStoreNotSupported,
|
||||
}
|
||||
|
||||
impl serde::ser::Error for Error {
|
||||
|
|
|
@ -91,9 +91,16 @@ impl FromV8 for V8Slice {
|
|||
scope: &mut v8::HandleScope,
|
||||
value: v8::Local<v8::Value>,
|
||||
) -> Result<Self, crate::Error> {
|
||||
to_ranged_buffer(scope, value)
|
||||
.and_then(|(b, r)| Self::from_buffer(b, r))
|
||||
.map_err(|_| crate::Error::ExpectedBuffer(value_to_type_str(value)))
|
||||
match to_ranged_buffer(scope, value) {
|
||||
Ok((b, r)) => {
|
||||
if b.get_backing_store().is_resizable_by_user_javascript() {
|
||||
return Err(crate::Error::ResizableBackingStoreNotSupported);
|
||||
}
|
||||
Self::from_buffer(b, r)
|
||||
.map_err(|_| crate::Error::ExpectedBuffer(value_to_type_str(value)))
|
||||
}
|
||||
Err(_) => Err(crate::Error::ExpectedBuffer(value_to_type_str(value))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -265,6 +265,16 @@ fn de_buffers() {
|
|||
assert_eq!(&*buf, &[0x68, 0x65, 0x6C, 0x6C, 0x6F]);
|
||||
},
|
||||
);
|
||||
|
||||
dedo("(new ArrayBuffer(4))", |scope, v| {
|
||||
let buf: ZeroCopyBuf = serde_v8::from_v8(scope, v).unwrap();
|
||||
assert_eq!(&*buf, &[0x0, 0x0, 0x0, 0x0]);
|
||||
});
|
||||
|
||||
dedo("(new ArrayBuffer(8, { maxByteLength: 16}))", |scope, v| {
|
||||
let result: Result<ZeroCopyBuf, Error> = serde_v8::from_v8(scope, v);
|
||||
matches!(result, Err(Error::ResizableBackingStoreNotSupported));
|
||||
});
|
||||
}
|
||||
|
||||
// Structs
|
||||
|
|
|
@ -5480,18 +5480,9 @@
|
|||
"Serializing a non-serializable platform object fails",
|
||||
"An object whose interface is deleted from the global must still deserialize",
|
||||
"A subclass instance will deserialize as its closest serializable superclass",
|
||||
"Resizable ArrayBuffer",
|
||||
"Growable SharedArrayBuffer",
|
||||
"Length-tracking TypedArray",
|
||||
"Length-tracking DataView",
|
||||
"Serializing OOB TypedArray throws",
|
||||
"Serializing OOB DataView throws",
|
||||
"A subclass instance will be received as its closest transferable superclass",
|
||||
"Resizable ArrayBuffer is transferable",
|
||||
"Length-tracking TypedArray is transferable",
|
||||
"Length-tracking DataView is transferable",
|
||||
"Transferring OOB TypedArray throws",
|
||||
"Transferring OOB DataView throws"
|
||||
"Transferring OOB TypedArray throws"
|
||||
],
|
||||
"structured-clone.any.worker.html": [
|
||||
"Blob basic",
|
||||
|
@ -5517,18 +5508,9 @@
|
|||
"Serializing a non-serializable platform object fails",
|
||||
"An object whose interface is deleted from the global must still deserialize",
|
||||
"A subclass instance will deserialize as its closest serializable superclass",
|
||||
"Resizable ArrayBuffer",
|
||||
"Growable SharedArrayBuffer",
|
||||
"Length-tracking TypedArray",
|
||||
"Length-tracking DataView",
|
||||
"Serializing OOB TypedArray throws",
|
||||
"Serializing OOB DataView throws",
|
||||
"A subclass instance will be received as its closest transferable superclass",
|
||||
"Resizable ArrayBuffer is transferable",
|
||||
"Length-tracking TypedArray is transferable",
|
||||
"Length-tracking DataView is transferable",
|
||||
"Transferring OOB TypedArray throws",
|
||||
"Transferring OOB DataView throws"
|
||||
"Transferring OOB TypedArray throws"
|
||||
]
|
||||
},
|
||||
"dynamic-markup-insertion": {
|
||||
|
@ -5659,95 +5641,8 @@
|
|||
},
|
||||
"infrastructure": {
|
||||
"safe-passing-of-structured-data": {
|
||||
"messagechannel.any.html": [
|
||||
"Blob basic",
|
||||
"Blob unpaired high surrogate (invalid utf-8)",
|
||||
"Blob unpaired low surrogate (invalid utf-8)",
|
||||
"Blob paired surrogates (invalid utf-8)",
|
||||
"Blob empty",
|
||||
"Blob NUL",
|
||||
"Array Blob object, Blob basic",
|
||||
"Array Blob object, Blob unpaired high surrogate (invalid utf-8)",
|
||||
"Array Blob object, Blob unpaired low surrogate (invalid utf-8)",
|
||||
"Array Blob object, Blob paired surrogates (invalid utf-8)",
|
||||
"Array Blob object, Blob empty",
|
||||
"Array Blob object, Blob NUL",
|
||||
"Array Blob object, two Blobs",
|
||||
"Object Blob object, Blob basic",
|
||||
"Object Blob object, Blob unpaired high surrogate (invalid utf-8)",
|
||||
"Object Blob object, Blob unpaired low surrogate (invalid utf-8)",
|
||||
"Object Blob object, Blob paired surrogates (invalid utf-8)",
|
||||
"Object Blob object, Blob empty",
|
||||
"Object Blob object, Blob NUL",
|
||||
"File basic",
|
||||
"FileList empty",
|
||||
"Array FileList object, FileList empty",
|
||||
"Object FileList object, FileList empty",
|
||||
"ImageData 1x1 transparent black",
|
||||
"ImageData 1x1 non-transparent non-black",
|
||||
"Array ImageData object, ImageData 1x1 transparent black",
|
||||
"Array ImageData object, ImageData 1x1 non-transparent non-black",
|
||||
"Object ImageData object, ImageData 1x1 transparent black",
|
||||
"Object ImageData object, ImageData 1x1 non-transparent non-black",
|
||||
"ImageBitmap 1x1 transparent black",
|
||||
"ImageBitmap 1x1 non-transparent non-black",
|
||||
"Array ImageBitmap object, ImageBitmap 1x1 transparent black",
|
||||
"Array ImageBitmap object, ImageBitmap 1x1 transparent non-black",
|
||||
"Object ImageBitmap object, ImageBitmap 1x1 transparent black",
|
||||
"Object ImageBitmap object, ImageBitmap 1x1 transparent non-black",
|
||||
"Serializing a non-serializable platform object fails",
|
||||
"An object whose interface is deleted from the global must still deserialize",
|
||||
"A subclass instance will deserialize as its closest serializable superclass",
|
||||
"Resizable ArrayBuffer",
|
||||
"Growable SharedArrayBuffer",
|
||||
"Length-tracking TypedArray",
|
||||
"Length-tracking DataView",
|
||||
"Serializing OOB TypedArray throws",
|
||||
"Serializing OOB DataView throws",
|
||||
"A subclass instance will be received as its closest transferable superclass",
|
||||
"Resizable ArrayBuffer is transferable",
|
||||
"Length-tracking TypedArray is transferable",
|
||||
"Length-tracking DataView is transferable",
|
||||
"Transferring OOB TypedArray throws",
|
||||
"Transferring OOB DataView throws"
|
||||
],
|
||||
"messagechannel.any.worker.html": [
|
||||
"Blob basic",
|
||||
"Blob unpaired high surrogate (invalid utf-8)",
|
||||
"Blob unpaired low surrogate (invalid utf-8)",
|
||||
"Blob paired surrogates (invalid utf-8)",
|
||||
"Blob empty",
|
||||
"Blob NUL",
|
||||
"Array Blob object, Blob basic",
|
||||
"Array Blob object, Blob unpaired high surrogate (invalid utf-8)",
|
||||
"Array Blob object, Blob unpaired low surrogate (invalid utf-8)",
|
||||
"Array Blob object, Blob paired surrogates (invalid utf-8)",
|
||||
"Array Blob object, Blob empty",
|
||||
"Array Blob object, Blob NUL",
|
||||
"Array Blob object, two Blobs",
|
||||
"Object Blob object, Blob basic",
|
||||
"Object Blob object, Blob unpaired high surrogate (invalid utf-8)",
|
||||
"Object Blob object, Blob unpaired low surrogate (invalid utf-8)",
|
||||
"Object Blob object, Blob paired surrogates (invalid utf-8)",
|
||||
"Object Blob object, Blob empty",
|
||||
"Object Blob object, Blob NUL",
|
||||
"File basic",
|
||||
"Serializing a non-serializable platform object fails",
|
||||
"An object whose interface is deleted from the global must still deserialize",
|
||||
"A subclass instance will deserialize as its closest serializable superclass",
|
||||
"Resizable ArrayBuffer",
|
||||
"Growable SharedArrayBuffer",
|
||||
"Length-tracking TypedArray",
|
||||
"Length-tracking DataView",
|
||||
"Serializing OOB TypedArray throws",
|
||||
"Serializing OOB DataView throws",
|
||||
"A subclass instance will be received as its closest transferable superclass",
|
||||
"Resizable ArrayBuffer is transferable",
|
||||
"Length-tracking TypedArray is transferable",
|
||||
"Length-tracking DataView is transferable",
|
||||
"Transferring OOB TypedArray throws",
|
||||
"Transferring OOB DataView throws"
|
||||
],
|
||||
"messagechannel.any.html": false,
|
||||
"messagechannel.any.worker.html": false,
|
||||
"shared-array-buffers": {
|
||||
"no-coop-coep.https.any.html": false,
|
||||
"no-coop-coep.https.any.worker.html": false,
|
||||
|
|
Loading…
Reference in a new issue