napi-rs/examples/napi/__tests__
Louis 43415251b8
feat(napi): allow Reference as a class method param (#1966)
As of before this commit, there was a lock in the codegen preventing Reference
from being used as a function argument outside of a Reference<Self>.

This changes it, allowing Reference of any class to be added as a class method
argument anywhere. It has the same limitations as reference, as in it requires
the class to have been created with a factory or constructor. This change
implements FromNapiValue on Reference, which will unwrap the class and call the
existing from_value_ptr method. It also updated typegen so that we only emit
the reference type if we're in an impl block that doesn't match the Reference
we're getting. This ensures that typegen works as expected with the previous
behaviour.
2024-02-22 22:37:50 +08:00
..
__snapshots__ feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
bun-test.js test: refactor the example tests to esm, add bun:test => ava polyfill (#1730) 2023-09-20 01:18:01 -07:00
error-msg.spec.ts feat: integrate with emnapi (#1669) 2023-11-02 12:57:11 +08:00
generator.spec.ts feat(napi): pass the rest of async tests (#1792) 2023-11-07 01:46:43 +08:00
object-attr.spec.ts feat(napi): pass the rest of async tests (#1792) 2023-11-07 01:46:43 +08:00
strict.spec.ts feat(napi): pass the rest of async tests (#1792) 2023-11-07 01:46:43 +08:00
test.framework.js test: refactor the example tests to esm, add bun:test => ava polyfill (#1730) 2023-09-20 01:18:01 -07:00
tsfn-error.cjs chore: upgrade emnapi dependencies (#1817) 2023-11-19 15:13:06 +08:00
typegen.spec.ts feat: integrate with emnapi (#1669) 2023-11-02 12:57:11 +08:00
unload.spec.js chore: upgrade emnapi dependencies (#1817) 2023-11-19 15:13:06 +08:00
values.spec.ts feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
worker-thread.spec.ts test(napi): decrease the worker sizes on Linux x64 musl platform 2023-11-20 23:07:43 +08:00
worker.cjs chore: upgrade emnapi dependencies (#1817) 2023-11-19 15:13:06 +08:00