diff options
author | 2022-08-09 16:17:11 -0700 | |
---|---|---|
committer | 2022-08-09 16:17:11 -0700 | |
commit | bbb6e25c68ff24615c84946a2f1c68d66b85ca3f (patch) | |
tree | 10fe9c5aebcb737a79dc953a4490c25b87b4366a /src/bun.js/bindings/JSFFIFunction.cpp | |
parent | b428227895b0fb29c9d9060b7d12191428e37736 (diff) | |
download | bun-bbb6e25c68ff24615c84946a2f1c68d66b85ca3f.tar.gz bun-bbb6e25c68ff24615c84946a2f1c68d66b85ca3f.tar.zst bun-bbb6e25c68ff24615c84946a2f1c68d66b85ca3f.zip |
[bun:ffi] Feature: Expose `ptr` on the FFI function
Diffstat (limited to 'src/bun.js/bindings/JSFFIFunction.cpp')
-rw-r--r-- | src/bun.js/bindings/JSFFIFunction.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bun.js/bindings/JSFFIFunction.cpp b/src/bun.js/bindings/JSFFIFunction.cpp index 731ea60c6..8410dc27a 100644 --- a/src/bun.js/bindings/JSFFIFunction.cpp +++ b/src/bun.js/bindings/JSFFIFunction.cpp @@ -68,6 +68,7 @@ DEFINE_VISIT_CHILDREN(JSFFIFunction); void JSFFIFunction::finishCreation(VM& vm, NativeExecutable* executable, unsigned length, const String& name) { Base::finishCreation(vm, executable, length, name); + this->putDirect(vm, JSC::Identifier::fromString(vm, String(MAKE_STATIC_STRING_IMPL("ptr"))), jsNumber(bitwise_cast<double>(this->m_function)), JSC::PropertyAttribute::ReadOnly | 0); ASSERT(inherits(info())); } |