diff options
| author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2022-02-18 14:21:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-18 17:51:19 +0530 |
| commit | b1a6555c0502196174bed1454e446717daf52f12 (patch) | |
| tree | 3e0c74d87a63044090564638dee0af22f4e2ca10 /test_ffi/tests/test.js | |
| parent | 4a144c7d6e55a5e047080cb1e2377b70657f1809 (diff) | |
feat(ext/ffi): Support read only global statics (#13662)
Diffstat (limited to 'test_ffi/tests/test.js')
| -rw-r--r-- | test_ffi/tests/test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index a9681ab9f..943f86ae8 100644 --- a/test_ffi/tests/test.js +++ b/test_ffi/tests/test.js @@ -73,6 +73,12 @@ const dylib = Deno.dlopen(libPath, { parameters: [], result: "pointer", }, + "static_u32": { + type: "u32", + }, + "static_ptr": { + type: "pointer", + }, }); dylib.symbols.printSomething(); @@ -201,6 +207,14 @@ dylib.symbols.sleep_nonblocking(100).then(() => { console.log("Before"); console.log(performance.now() - start < 100); +console.log("Static u32:", dylib.symbols.static_u32); +console.log( + "Static ptr:", + dylib.symbols.static_ptr instanceof Deno.UnsafePointer, +); +const view = new Deno.UnsafePointerView(dylib.symbols.static_ptr); +console.log("Static ptr value:", view.getUint32()); + function cleanup() { dylib.close(); |
