Skip to content

Commit

Permalink
fix(WebAssembly): Fix WebAssembly NativeError types
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Dec 2, 2020
1 parent ac1855b commit 9804caf
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 15 deletions.
15 changes: 9 additions & 6 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19053,12 +19053,13 @@ declare namespace CSS {
}

declare namespace WebAssembly {
interface CompileError {
interface CompileError extends Error {
}

var CompileError: {
prototype: CompileError;
new(): CompileError;
new(message?: string): CompileError;
(message?: string): CompileError;
};

interface Global {
Expand All @@ -19080,12 +19081,13 @@ declare namespace WebAssembly {
new(module: Module, importObject?: Imports): Instance;
};

interface LinkError {
interface LinkError extends Error {
}

var LinkError: {
prototype: LinkError;
new(): LinkError;
new(message?: string): LinkError;
(message?: string): LinkError;
};

interface Memory {
Expand All @@ -19109,12 +19111,13 @@ declare namespace WebAssembly {
imports(moduleObject: Module): ModuleImportDescriptor[];
};

interface RuntimeError {
interface RuntimeError extends Error {
}

var RuntimeError: {
prototype: RuntimeError;
new(): RuntimeError;
new(message?: string): RuntimeError;
(message?: string): RuntimeError;
};

interface Table {
Expand Down
15 changes: 9 additions & 6 deletions baselines/webassembly.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
/////////////////////////////

declare namespace WebAssembly {
interface CompileError {
interface CompileError extends Error {
}

var CompileError: {
prototype: CompileError;
new(): CompileError;
new(message?: string): CompileError;
(message?: string): CompileError;
};

interface Global {
Expand All @@ -30,12 +31,13 @@ declare namespace WebAssembly {
new(module: Module, importObject?: Imports): Instance;
};

interface LinkError {
interface LinkError extends Error {
}

var LinkError: {
prototype: LinkError;
new(): LinkError;
new(message?: string): LinkError;
(message?: string): LinkError;
};

interface Memory {
Expand All @@ -59,12 +61,13 @@ declare namespace WebAssembly {
imports(moduleObject: Module): ModuleImportDescriptor[];
};

interface RuntimeError {
interface RuntimeError extends Error {
}

var RuntimeError: {
prototype: RuntimeError;
new(): RuntimeError;
new(message?: string): RuntimeError;
(message?: string): RuntimeError;
};

interface Table {
Expand Down
27 changes: 27 additions & 0 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5744,6 +5744,15 @@ interface Console {
declare var console: Console;

declare namespace WebAssembly {
interface CompileError extends Error {
}

var CompileError: {
prototype: CompileError;
new(message?: string): CompileError;
(message?: string): CompileError;
};

interface Global {
value: any;
valueOf(): any;
Expand All @@ -5763,6 +5772,15 @@ declare namespace WebAssembly {
new(module: Module, importObject?: Imports): Instance;
};

interface LinkError extends Error {
}

var LinkError: {
prototype: LinkError;
new(message?: string): LinkError;
(message?: string): LinkError;
};

interface Memory {
readonly buffer: ArrayBuffer;
grow(delta: number): number;
Expand All @@ -5784,6 +5802,15 @@ declare namespace WebAssembly {
imports(moduleObject: Module): ModuleImportDescriptor[];
};

interface RuntimeError extends Error {
}

var RuntimeError: {
prototype: RuntimeError;
new(message?: string): RuntimeError;
(message?: string): RuntimeError;
};

interface Table {
readonly length: number;
get(index: number): Function | null;
Expand Down
6 changes: 3 additions & 3 deletions inputfiles/idl/WebAssembly JavaScript Interface.widl
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ interface Global {
attribute any value;
};

[LegacyNamespace=WebAssembly]
[LegacyNamespace=WebAssembly, Exposed=(Window,Worker,Worklet)]
interface CompileError { };

[LegacyNamespace=WebAssembly]
[LegacyNamespace=WebAssembly, Exposed=(Window,Worker,Worklet)]
interface LinkError { };

[LegacyNamespace=WebAssembly]
[LegacyNamespace=WebAssembly, Exposed=(Window,Worker,Worklet)]
interface RuntimeError { };
27 changes: 27 additions & 0 deletions inputfiles/overridingTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2566,6 +2566,33 @@
}
}
}
},
"CompileError": {
"extends": "Error",
"constructor": {
"override-signatures": [
"new(message?: string): CompileError",
"(message?: string): CompileError"
]
}
},
"LinkError": {
"extends": "Error",
"constructor": {
"override-signatures": [
"new(message?: string): LinkError",
"(message?: string): LinkError"
]
}
},
"RuntimeError": {
"extends": "Error",
"constructor": {
"override-signatures": [
"new(message?: string): RuntimeError",
"(message?: string): RuntimeError"
]
}
}
}
},
Expand Down

0 comments on commit 9804caf

Please sign in to comment.