mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
fix(ext/ffi): pointer
type can accept null
(#13335)
This commit is contained in:
parent
5680d33dd9
commit
a7ea93b978
2 changed files with 2 additions and 2 deletions
2
cli/dts/lib.deno.unstable.d.ts
vendored
2
cli/dts/lib.deno.unstable.d.ts
vendored
|
@ -151,7 +151,7 @@ declare namespace Deno {
|
||||||
|
|
||||||
type StaticForeignFunctionParameter<T> = T extends "void" ? void
|
type StaticForeignFunctionParameter<T> = T extends "void" ? void
|
||||||
: T extends StaticNativeNumberType ? number
|
: T extends StaticNativeNumberType ? number
|
||||||
: T extends "pointer" ? Deno.UnsafePointer | Deno.TypedArray
|
: T extends "pointer" ? Deno.UnsafePointer | Deno.TypedArray | null
|
||||||
: unknown;
|
: unknown;
|
||||||
|
|
||||||
/** Infers a foreign function parameter list. */
|
/** Infers a foreign function parameter list. */
|
||||||
|
|
|
@ -86,7 +86,7 @@ remote.symbols.method14(null);
|
||||||
remote.symbols.method14(0);
|
remote.symbols.method14(0);
|
||||||
|
|
||||||
// @ts-expect-error: Invalid argument
|
// @ts-expect-error: Invalid argument
|
||||||
remote.symbols.method15(null);
|
remote.symbols.method15(0);
|
||||||
remote.symbols.method15(new Uint16Array(1));
|
remote.symbols.method15(new Uint16Array(1));
|
||||||
remote.symbols.method15({} as Deno.UnsafePointer);
|
remote.symbols.method15({} as Deno.UnsafePointer);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue