You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 21, 2018. It is now read-only.
Recently, I am interesting in abstracing JS API, and have some general idea after comparing APIs between v8, jsc, chakra and spidermonkey. Hence, I have some issues about JS API(not include node-api temporarily).
c OR c++ form?
jsc, chakra and spidermonkey API are all written in C, while v8.h is written in C++. Of cause, C++ maybe more friendly to C++ programme(include add-on developer) , but C would be less consume and more like JNI.
how to deal with persistent in v8(or global ref in else JS Engine)?
Is there any necessary to define a data type named "GlobalValue" to indicate a persistent data which is rooted? We all know that in JNI, there is no data type like above, so many developer with JNI would confuse about whether this data is local or not.
wrap c++ class
I find that JSC and Spidermonkey provide a API to wrap a c++ class written by developer , and map to a JS object, so that they can new a JS object in JS file, with a C++ construct. For example, in JSC, they define a class with JSClassDefinition, and define a class with JSClassCreate, so they can use it in JS. Should the JS API provide this feature?
argument check
Is there any necessary to provide a argument check just like check_jni.h in Dalvik/art in Android?
InternalField
InternalField in v8 ,external data in chakra or Private in spidermoneky can store a pointer to C++ object for native developer, but this is easy to lead to memory leak(i.e developer forget to release the object binding to a JS object). What can JS API do for this situation?
Recently, I am interesting in abstracing JS API, and have some general idea after comparing APIs between v8, jsc, chakra and spidermonkey. Hence, I have some issues about JS API(not include node-api temporarily).
jsc, chakra and spidermonkey API are all written in C, while v8.h is written in C++. Of cause, C++ maybe more friendly to C++ programme(include add-on developer) , but C would be less consume and more like JNI.
I have see some data types's abstract to review:
(https://github.com/nodejs/api/blob/master/native/data_types.md)
Is this a final design? What about abstract many data types, such as JSObject JSFunction JSNumber ..., as what JNI did?
Is there any necessary to define a data type named "GlobalValue" to indicate a persistent data which is rooted? We all know that in JNI, there is no data type like above, so many developer with JNI would confuse about whether this data is local or not.
I find that JSC and Spidermonkey provide a API to wrap a c++ class written by developer , and map to a JS object, so that they can new a JS object in JS file, with a C++ construct. For example, in JSC, they define a class with JSClassDefinition, and define a class with JSClassCreate, so they can use it in JS. Should the JS API provide this feature?
Is there any necessary to provide a argument check just like check_jni.h in Dalvik/art in Android?
InternalField in v8 ,external data in chakra or Private in spidermoneky can store a pointer to C++ object for native developer, but this is easy to lead to memory leak(i.e developer forget to release the object binding to a JS object). What can JS API do for this situation?