Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade deno_core #21036

Merged
merged 7 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -38,8 +38,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