1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 16:49:18 -05:00

chore: don't expose FFI ops to user code (#22313)

This commit removes some not really necessary FFI tests and in effect
removes them from being accessible from the user code.

This lowers the number of ops accessible to user code to 16.
This commit is contained in:
Bartek Iwańczuk 2024-02-07 04:15:11 +01:00 committed by GitHub
parent 227ec14e6c
commit edab1bb927
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 1 additions and 204 deletions

View file

@ -3603,120 +3603,6 @@ itest!(fetch_async_error_stack {
exit_code: 1,
});
itest!(unstable_ffi_1 {
args: "run run/ffi/unstable_ffi_1.js",
output: "run/ffi/unstable_ffi_1.js.out",
exit_code: 70,
});
itest!(unstable_ffi_2 {
args: "run run/ffi/unstable_ffi_2.js",
output: "run/ffi/unstable_ffi_2.js.out",
exit_code: 70,
});
itest!(unstable_ffi_3 {
args: "run run/ffi/unstable_ffi_3.js",
output: "run/ffi/unstable_ffi_3.js.out",
exit_code: 70,
});
itest!(unstable_ffi_4 {
args: "run run/ffi/unstable_ffi_4.js",
output: "run/ffi/unstable_ffi_4.js.out",
exit_code: 70,
});
itest!(unstable_ffi_5 {
args: "run run/ffi/unstable_ffi_5.js",
output: "run/ffi/unstable_ffi_5.js.out",
exit_code: 70,
});
itest!(unstable_ffi_6 {
args: "run run/ffi/unstable_ffi_6.js",
output: "run/ffi/unstable_ffi_6.js.out",
exit_code: 70,
});
itest!(unstable_ffi_7 {
args: "run run/ffi/unstable_ffi_7.js",
output: "run/ffi/unstable_ffi_7.js.out",
exit_code: 70,
});
itest!(unstable_ffi_8 {
args: "run run/ffi/unstable_ffi_8.js",
output: "run/ffi/unstable_ffi_8.js.out",
exit_code: 70,
});
itest!(unstable_ffi_9 {
args: "run run/ffi/unstable_ffi_9.js",
output: "run/ffi/unstable_ffi_9.js.out",
exit_code: 70,
});
itest!(unstable_ffi_10 {
args: "run run/ffi/unstable_ffi_10.js",
output: "run/ffi/unstable_ffi_10.js.out",
exit_code: 70,
});
itest!(unstable_ffi_11 {
args: "run run/ffi/unstable_ffi_11.js",
output: "run/ffi/unstable_ffi_11.js.out",
exit_code: 70,
});
itest!(unstable_ffi_12 {
args: "run run/ffi/unstable_ffi_12.js",
output: "run/ffi/unstable_ffi_12.js.out",
exit_code: 70,
});
itest!(unstable_ffi_13 {
args: "run run/ffi/unstable_ffi_13.js",
output: "run/ffi/unstable_ffi_13.js.out",
exit_code: 70,
});
itest!(unstable_ffi_14 {
args: "run run/ffi/unstable_ffi_14.js",
output: "run/ffi/unstable_ffi_14.js.out",
exit_code: 70,
});
itest!(unstable_ffi_15 {
args: "run run/ffi/unstable_ffi_15.js",
output: "run/ffi/unstable_ffi_15.js.out",
exit_code: 70,
});
itest!(unstable_ffi_16 {
args: "run run/ffi/unstable_ffi_16.js",
output: "run/ffi/unstable_ffi_16.js.out",
exit_code: 70,
});
itest!(unstable_ffi_17 {
args: "run run/ffi/unstable_ffi_17.js",
output: "run/ffi/unstable_ffi_17.js.out",
exit_code: 70,
});
itest!(unstable_ffi_18 {
args: "run run/ffi/unstable_ffi_18.js",
output: "run/ffi/unstable_ffi_18.js.out",
exit_code: 70,
});
itest!(unstable_ffi_19 {
args: "run run/ffi/unstable_ffi_19.js",
output: "run/ffi/unstable_ffi_19.js.out",
exit_code: 70,
});
itest!(event_listener_error {
args: "run --quiet run/event_listener_error.ts",
output: "run/event_listener_error.ts.out",

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_load({ path: "", symbols: {} });

View file

@ -1 +0,0 @@
Unstable API 'Deno.dlopen'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_i16(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getInt16'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_u32(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getUint32'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_i32(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getInt32'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_u64(null, 0, new Uint32Array(2));

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getBigUint64'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_f32(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getFloat32'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_f64(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getFloat64'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_ptr_value(null, new Uint32Array(2));

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointer#value'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_get_buf(null, 0, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getArrayBuffer'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_ptr_create(1);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointer#create'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_ptr_equals(null, null);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointer#equals'. The `--unstable-ffi` flag must be provided.

View file

@ -1,5 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_call_ptr(null, {
name: null,
parameters: [],
result: "void",
}, []);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafeFnPointer#call'. The `--unstable-ffi` flag must be provided.

View file

@ -1,7 +0,0 @@
const { op_ffi_call_ptr_nonblocking } = Deno[Deno.internal].core
.ensureFastOps();
op_ffi_call_ptr_nonblocking(null, {
name: null,
parameters: [],
result: "void",
}, []);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafeFnPointer#call'. The `--unstable-ffi` flag must be provided.

View file

@ -1,4 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_ptr_of(
new Uint8Array(0),
new Uint32Array(2),
);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointer#of'. The `--unstable-ffi` flag must be provided.

View file

@ -1,6 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_buf_copy_into(
null,
0,
new Uint8Array(0),
0,
);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#copyInto'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_cstr_read(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getCString'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_u8(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getUint8'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_i8(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getInt8'. The `--unstable-ffi` flag must be provided.

View file

@ -1 +0,0 @@
Deno[Deno.internal].core.ops.op_ffi_read_u16(null, 0);

View file

@ -1 +0,0 @@
Unstable API 'Deno.UnsafePointerView#getUint16'. The `--unstable-ffi` flag must be provided.

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
const EXPECTED_OP_COUNT = 45;
const EXPECTED_OP_COUNT = 16;
Deno.test(function checkExposedOps() {
// @ts-ignore TS doesn't allow to index with symbol

View file

@ -586,39 +586,6 @@ const NOT_IMPORTED_OPS = [
"op_napi_open",
"op_npm_process_state",
// TODO(bartlomieju): used in integration tests for FFI API, to check if
// they require unstable flag. These tests are questionable and should be
// removed (most likely).
"op_ffi_buf_copy_into",
"op_ffi_call_nonblocking",
"op_ffi_call_ptr_nonblocking",
"op_ffi_call_ptr",
"op_ffi_cstr_read",
"op_ffi_get_buf",
"op_ffi_get_static",
"op_ffi_load",
"op_ffi_ptr_create",
"op_ffi_ptr_equals",
"op_ffi_ptr_of_exact",
"op_ffi_ptr_of",
"op_ffi_ptr_offset",
"op_ffi_ptr_value",
"op_ffi_read_bool",
"op_ffi_read_f32",
"op_ffi_read_f64",
"op_ffi_read_i16",
"op_ffi_read_i32",
"op_ffi_read_i64",
"op_ffi_read_i8",
"op_ffi_read_ptr",
"op_ffi_read_u16",
"op_ffi_read_u32",
"op_ffi_read_u64",
"op_ffi_read_u8",
"op_ffi_unsafe_callback_close",
"op_ffi_unsafe_callback_create",
"op_ffi_unsafe_callback_ref",
// TODO(bartlomieju): used in a regression test, but probably not needed
// anymore if ops are not user accessible.
"op_spawn_child",