Skip to content

Commit

Permalink
chore: upgrade deno_core (denoland#21036)
Browse files Browse the repository at this point in the history
Updated to deno_core 0.224.0 and V8 12.0.

---------

Co-authored-by: Aapo Alasuutari <[email protected]>
  • Loading branch information
bartlomieju and aapoalas committed Nov 1, 2023
1 parent 01d3e0f commit 1d19b10
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ license = "MIT"
repository = "https://github.com/denoland/deno"

[workspace.dependencies]
deno_ast = { version = "0.31.0", features = ["transpiling"] }
deno_core = { version = "0.223.0" }
deno_ast = { version = "0.31.2", features = ["transpiling"] }
deno_core = { version = "0.224.0" }

deno_runtime = { version = "0.129.0", path = "./runtime" }
napi_sym = { version = "0.51.0", path = "./cli/napi/sym" }
Expand Down
10 changes: 6 additions & 4 deletions cli/tests/node_compat/test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ const assert = require('assert');

const SlowBuffer = require('buffer').SlowBuffer;

// TODO(bartlomieju): this test started failing after update to V8 12.0,
// maybe the size limit was increased?
// Verify the maximum Uint8Array size. There is no concrete limit by spec. The
// internal limits should be updated if this fails.
assert.throws(
() => new Uint8Array(2 ** 32 + 1),
{ message: 'Invalid typed array length: 4294967297' }
);
// assert.throws(
// () => new Uint8Array(2 ** 32 + 1),
// { message: 'Invalid typed array length: 4294967297' }
// );

const b = Buffer.allocUnsafe(1024);
assert.strictEqual(b.length, 1024);
Expand Down
15 changes: 14 additions & 1 deletion cli/tests/unit/globals_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// deno-lint-ignore-file no-window-prefix
import { assert, assertEquals } from "./test_util.ts";
import { assert, assertEquals, assertRejects } from "./test_util.ts";

Deno.test(function globalThisExists() {
assert(globalThis != null);
Expand Down Expand Up @@ -140,3 +140,16 @@ Deno.test(function windowNameIsDefined() {
assertEquals(window.name, "");
assertEquals(name, "");
});

Deno.test(async function promiseWithResolvers() {
{
const { promise, resolve } = Promise.withResolvers();
resolve(true);
assert(await promise);
}
{
const { promise, reject } = Promise.withResolvers();
reject(new Error("boom!"));
await assertRejects(() => promise, Error, "boom!");
}
});
6 changes: 6 additions & 0 deletions cli/tsc/dts/lib.es2021.promise.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ interface PromiseConstructor {
* @returns A new Promise.
*/
any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>

/**
* Creates a Promise that can be resolved or rejected using provided functions.
* @returns An object containing `promise` promise object, `resolve` and `reject` functions.
*/
withResolvers<T>(): { promise: Promise<T>, resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void };
}
11 changes: 6 additions & 5 deletions test_ffi/tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,12 @@ assertEquals(isNullBuffer(new Uint8Array()), false, "isNullBuffer(new Uint8Array

// Externally backed ArrayBuffer has a non-null data pointer, even though its length is zero.
const externalZeroBuffer = new Uint8Array(Deno.UnsafePointerView.getArrayBuffer(ptr0, 0));
// However: V8 Fast calls get null pointers for zero-sized buffers.
assertEquals(isNullBuffer(externalZeroBuffer), true, "isNullBuffer(externalZeroBuffer) !== true");
// Also: V8's `Local<ArrayBuffer>->Data()` method returns null pointers for zero-sized buffers.
// Using `Local<ArrayBuffer>->GetBackingStore()->Data()` would give the original pointer.
assertEquals(isNullBufferDeopt(externalZeroBuffer), true, "isNullBufferDeopt(externalZeroBuffer) !== true");
// V8 Fast calls used to get null pointers for all zero-sized buffers no matter their external backing.
assertEquals(isNullBuffer(externalZeroBuffer), false, "isNullBuffer(externalZeroBuffer) !== false");
// V8's `Local<ArrayBuffer>->Data()` method also used to similarly return null pointers for all
// zero-sized buffers which would not match what `Local<ArrayBuffer>->GetBackingStore()->Data()`
// API returned. These issues have been fixed in https://bugs.chromium.org/p/v8/issues/detail?id=13488.
assertEquals(isNullBufferDeopt(externalZeroBuffer), false, "isNullBufferDeopt(externalZeroBuffer) !== false");

// The same pointer with a non-zero byte length for the buffer will return non-null pointers in
// both Fast call and V8 API calls.
Expand Down

0 comments on commit 1d19b10

Please sign in to comment.