Replies: 1 comment
-
One of n-api's design goals is making it easy to port over to other JS engines and that constrains the API surface. Taking quickjs as a, ah, quick litmus test, I don't think it exposes regexp functionality through its C API. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the process of writing some data marshalling code, I noticed that napi does not have support for RegExp. Is this intentional due to a technical issue? Or just something that hasn't been done yet?
I am willing to write the code (and documentation) for the following proposed RegExp support. The naming conventions are modeled after the similar string functions.
The
napi_get_value_regexp_*
functions would support the usual convention of returning the length of the strings whensource
andflags
are NULL.The flags are represented as strings even though v8 uses a bitmask, and should provide better portability to other platforms.
Any thoughts on this would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions