-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
napi_create_external
and napi_get_value_external
- Loading branch information
1 parent
7ce8328
commit dddbce8
Showing
14 changed files
with
342 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,20 @@ | ||
#include "napi_external.h" | ||
#include "napi.h" | ||
|
||
namespace Bun { | ||
|
||
// #pragma once | ||
NapiExternal::~NapiExternal() | ||
{ | ||
if (finalizer) { | ||
finalizer(toNapi(globalObject()), m_value, m_finalizerHint); | ||
} | ||
} | ||
|
||
// #include "root.h" | ||
void NapiExternal::destroy(JSC::JSCell* cell) | ||
{ | ||
jsCast<NapiExternal*>(cell)->~NapiExternal(); | ||
} | ||
|
||
// #include "BunBuiltinNames.h" | ||
// #include "BunClientData.h" | ||
const ClassInfo NapiExternal::s_info = { "External"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(NapiExternal) }; | ||
|
||
// namespace Zig { | ||
|
||
// using namespace JSC; | ||
|
||
// class NapiExternal : public JSC::JSNonFinalObject { | ||
// using Base = JSC::JSNonFinalObject; | ||
|
||
// public: | ||
// NapiExternal(JSC::VM& vm, JSC::Structure* structure) | ||
// : Base(vm, structure) | ||
// { | ||
// } | ||
|
||
// DECLARE_INFO; | ||
|
||
// static constexpr unsigned StructureFlags = Base::StructureFlags; | ||
|
||
// template<typename CellType, SubspaceAccess> static GCClient::IsoSubspace* subspaceFor(VM& vm) | ||
// { | ||
// return &vm.plainObjectSpace(); | ||
// } | ||
|
||
// static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, | ||
// JSC::JSValue prototype) | ||
// { | ||
// return JSC::Structure::create(vm, globalObject, prototype, | ||
// JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); | ||
// } | ||
|
||
// static NapiExternal* create(JSC::VM& vm, JSC::Structure* structure) | ||
// { | ||
// NapiExternal* accessor = new (NotNull, JSC::allocateCell<NapiExternal>(vm)) NapiExternal(vm, structure); | ||
// accessor->finishCreation(vm); | ||
// return accessor; | ||
// } | ||
|
||
// void finishCreation(JSC::VM& vm); | ||
// void* m_value; | ||
// }; | ||
|
||
// } // namespace Zig | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,4 +126,6 @@ | |
_napi_unwrap; | ||
_napi_wrap; | ||
_napi_remove_wrap; | ||
_napi_create_external; | ||
_napi_get_value_external; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "../../src/napi/node_api.h" | ||
|
||
void |
Empty file.
Binary file not shown.
Oops, something went wrong.