mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 20:38:55 +00:00
docs: fix casing of Wasm (#26954)
This commit is contained in:
parent
d17f4590a2
commit
be10901dfc
58
cli/tsc/dts/lib.deno.shared_globals.d.ts
vendored
58
cli/tsc/dts/lib.deno.shared_globals.d.ts
vendored
@ -15,14 +15,14 @@
|
|||||||
/// <reference lib="deno.crypto" />
|
/// <reference lib="deno.crypto" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
|
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
declare namespace WebAssembly {
|
declare namespace WebAssembly {
|
||||||
/**
|
/**
|
||||||
* The `WebAssembly.CompileError` object indicates an error during WebAssembly decoding or validation.
|
* The `WebAssembly.CompileError` object indicates an error during WebAssembly decoding or validation.
|
||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class CompileError extends Error {
|
export class CompileError extends Error {
|
||||||
/** Creates a new `WebAssembly.CompileError` object. */
|
/** Creates a new `WebAssembly.CompileError` object. */
|
||||||
@ -36,7 +36,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class Global {
|
export class Global {
|
||||||
/** Creates a new `Global` object. */
|
/** Creates a new `Global` object. */
|
||||||
@ -59,7 +59,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class Instance {
|
export class Instance {
|
||||||
/** Creates a new Instance object. */
|
/** Creates a new Instance object. */
|
||||||
@ -79,7 +79,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class LinkError extends Error {
|
export class LinkError extends Error {
|
||||||
/** Creates a new WebAssembly.LinkError object. */
|
/** Creates a new WebAssembly.LinkError object. */
|
||||||
@ -95,7 +95,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class Memory {
|
export class Memory {
|
||||||
/** Creates a new `Memory` object. */
|
/** Creates a new `Memory` object. */
|
||||||
@ -117,7 +117,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class Module {
|
export class Module {
|
||||||
/** Creates a new `Module` object. */
|
/** Creates a new `Module` object. */
|
||||||
@ -145,7 +145,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class RuntimeError extends Error {
|
export class RuntimeError extends Error {
|
||||||
/** Creates a new `WebAssembly.RuntimeError` object. */
|
/** Creates a new `WebAssembly.RuntimeError` object. */
|
||||||
@ -160,7 +160,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export class Table {
|
export class Table {
|
||||||
/** Creates a new `Table` object. */
|
/** Creates a new `Table` object. */
|
||||||
@ -182,7 +182,7 @@ declare namespace WebAssembly {
|
|||||||
/** The `GlobalDescriptor` describes the options you can pass to
|
/** The `GlobalDescriptor` describes the options you can pass to
|
||||||
* `new WebAssembly.Global()`.
|
* `new WebAssembly.Global()`.
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export interface GlobalDescriptor {
|
export interface GlobalDescriptor {
|
||||||
mutable?: boolean;
|
mutable?: boolean;
|
||||||
@ -192,7 +192,7 @@ declare namespace WebAssembly {
|
|||||||
/** The `MemoryDescriptor` describes the options you can pass to
|
/** The `MemoryDescriptor` describes the options you can pass to
|
||||||
* `new WebAssembly.Memory()`.
|
* `new WebAssembly.Memory()`.
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export interface MemoryDescriptor {
|
export interface MemoryDescriptor {
|
||||||
initial: number;
|
initial: number;
|
||||||
@ -203,7 +203,7 @@ declare namespace WebAssembly {
|
|||||||
/** A `ModuleExportDescriptor` is the description of a declared export in a
|
/** A `ModuleExportDescriptor` is the description of a declared export in a
|
||||||
* `WebAssembly.Module`.
|
* `WebAssembly.Module`.
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export interface ModuleExportDescriptor {
|
export interface ModuleExportDescriptor {
|
||||||
kind: ImportExportKind;
|
kind: ImportExportKind;
|
||||||
@ -213,7 +213,7 @@ declare namespace WebAssembly {
|
|||||||
/** A `ModuleImportDescriptor` is the description of a declared import in a
|
/** A `ModuleImportDescriptor` is the description of a declared import in a
|
||||||
* `WebAssembly.Module`.
|
* `WebAssembly.Module`.
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export interface ModuleImportDescriptor {
|
export interface ModuleImportDescriptor {
|
||||||
kind: ImportExportKind;
|
kind: ImportExportKind;
|
||||||
@ -224,7 +224,7 @@ declare namespace WebAssembly {
|
|||||||
/** The `TableDescriptor` describes the options you can pass to
|
/** The `TableDescriptor` describes the options you can pass to
|
||||||
* `new WebAssembly.Table()`.
|
* `new WebAssembly.Table()`.
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export interface TableDescriptor {
|
export interface TableDescriptor {
|
||||||
element: TableKind;
|
element: TableKind;
|
||||||
@ -234,7 +234,7 @@ declare namespace WebAssembly {
|
|||||||
|
|
||||||
/** The value returned from `WebAssembly.instantiate`.
|
/** The value returned from `WebAssembly.instantiate`.
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export interface WebAssemblyInstantiatedSource {
|
export interface WebAssemblyInstantiatedSource {
|
||||||
/* A `WebAssembly.Instance` object that contains all the exported WebAssembly functions. */
|
/* A `WebAssembly.Instance` object that contains all the exported WebAssembly functions. */
|
||||||
@ -247,21 +247,21 @@ declare namespace WebAssembly {
|
|||||||
module: Module;
|
module: Module;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type ImportExportKind = "function" | "global" | "memory" | "table";
|
export type ImportExportKind = "function" | "global" | "memory" | "table";
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type TableKind = "anyfunc";
|
export type TableKind = "anyfunc";
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type ValueType = "f32" | "f64" | "i32" | "i64";
|
export type ValueType = "f32" | "f64" | "i32" | "i64";
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type ExportValue = Function | Global | Memory | Table;
|
export type ExportValue = Function | Global | Memory | Table;
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type Exports = Record<string, ExportValue>;
|
export type Exports = Record<string, ExportValue>;
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type ImportValue = ExportValue | number;
|
export type ImportValue = ExportValue | number;
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type ModuleImports = Record<string, ImportValue>;
|
export type ModuleImports = Record<string, ImportValue>;
|
||||||
/** @category WASM */
|
/** @category Wasm */
|
||||||
export type Imports = Record<string, ModuleImports>;
|
export type Imports = Record<string, ModuleImports>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -272,7 +272,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export function compile(bytes: BufferSource): Promise<Module>;
|
export function compile(bytes: BufferSource): Promise<Module>;
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export function compileStreaming(
|
export function compileStreaming(
|
||||||
source: Response | Promise<Response>,
|
source: Response | Promise<Response>,
|
||||||
@ -301,7 +301,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export function instantiate(
|
export function instantiate(
|
||||||
bytes: BufferSource,
|
bytes: BufferSource,
|
||||||
@ -318,7 +318,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export function instantiate(
|
export function instantiate(
|
||||||
moduleObject: Module,
|
moduleObject: Module,
|
||||||
@ -332,7 +332,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export function instantiateStreaming(
|
export function instantiateStreaming(
|
||||||
response: Response | PromiseLike<Response>,
|
response: Response | PromiseLike<Response>,
|
||||||
@ -346,7 +346,7 @@ declare namespace WebAssembly {
|
|||||||
*
|
*
|
||||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate)
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate)
|
||||||
*
|
*
|
||||||
* @category WASM
|
* @category Wasm
|
||||||
*/
|
*/
|
||||||
export function validate(bytes: BufferSource): boolean;
|
export function validate(bytes: BufferSource): boolean;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// https://github.com/denoland/deno/issues/12263
|
// https://github.com/denoland/deno/issues/12263
|
||||||
// Test for a panic that happens when a worker is closed in the reactions of a
|
// Test for a panic that happens when a worker is closed in the reactions of a
|
||||||
// WASM async operation.
|
// Wasm async operation.
|
||||||
|
|
||||||
// The minimum valid wasm module, plus two additional zero bytes.
|
// The minimum valid wasm module, plus two additional zero bytes.
|
||||||
const buffer = new Uint8Array([
|
const buffer = new Uint8Array([
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// https://github.com/denoland/deno/issues/12263
|
// https://github.com/denoland/deno/issues/12263
|
||||||
// Test for a panic that happens when a worker is closed in the reactions of a
|
// Test for a panic that happens when a worker is closed in the reactions of a
|
||||||
// WASM async operation.
|
// Wasm async operation.
|
||||||
|
|
||||||
new Worker(
|
new Worker(
|
||||||
import.meta.resolve("./close_in_wasm_reactions.js"),
|
import.meta.resolve("./close_in_wasm_reactions.js"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// https://github.com/denoland/deno/issues/12263
|
// https://github.com/denoland/deno/issues/12263
|
||||||
// Test for a panic that happens when a worker is closed in the reactions of a
|
// Test for a panic that happens when a worker is closed in the reactions of a
|
||||||
// WASM async operation.
|
// Wasm async operation.
|
||||||
|
|
||||||
// The minimum valid wasm module, plus two additional zero bytes.
|
// The minimum valid wasm module, plus two additional zero bytes.
|
||||||
const buffer = new Uint8Array([
|
const buffer = new Uint8Array([
|
||||||
|
@ -32,7 +32,7 @@ Deno.test(async function wasmInstantiateWorksWithBuffer() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// V8's default implementation of `WebAssembly.instantiateStreaming()` if you
|
// V8's default implementation of `WebAssembly.instantiateStreaming()` if you
|
||||||
// don't set the WASM streaming callback, is to take a byte source. Here we
|
// don't set the Wasm streaming callback, is to take a byte source. Here we
|
||||||
// check that our implementation of the callback disallows it.
|
// check that our implementation of the callback disallows it.
|
||||||
Deno.test(
|
Deno.test(
|
||||||
async function wasmInstantiateStreamingFailsWithBuffer() {
|
async function wasmInstantiateStreamingFailsWithBuffer() {
|
||||||
@ -95,7 +95,7 @@ Deno.test(
|
|||||||
Deno.test(
|
Deno.test(
|
||||||
{ permissions: { net: true } },
|
{ permissions: { net: true } },
|
||||||
async function wasmStreamingNonTrivial() {
|
async function wasmStreamingNonTrivial() {
|
||||||
// deno-dom's WASM file is a real-world non-trivial case that gave us
|
// deno-dom's Wasm file is a real-world non-trivial case that gave us
|
||||||
// trouble when implementing this.
|
// trouble when implementing this.
|
||||||
await WebAssembly.instantiateStreaming(fetch(
|
await WebAssembly.instantiateStreaming(fetch(
|
||||||
"http://localhost:4545/assets/deno_dom_0.1.3-alpha2.wasm",
|
"http://localhost:4545/assets/deno_dom_0.1.3-alpha2.wasm",
|
||||||
|
Loading…
Reference in New Issue
Block a user