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
The RegExp constructor is exported as exports["RegExp#constructor"] with a signature of (this_: RegExp, regex: string, flags: string) => RegExp (all pointers, the this_ argument is typically 0 to indicate that the ctor should allocate on its own, i.e. not a super() call). During demangling, the loader creates a function exports.RegExp one can use with and without new representing it, and one can invoke new exports.RegExp(regexPtr, flagsPtr) (without this_) effectively corresponding to exports.createRegExp(regexPtr, flagsPtr), but returning a wrapper class instead of just a pointer.
There may be value in exposing createRegExp, though, for where the loader is not used, i.e. when running the binary in a C or Rust host. The AS compiler typically does this to also provide an easy to use C-like interface that works everywhere.
The text was updated successfully, but these errors were encountered:
assemblyscript-regex/assembly/regexp.ts
Lines 153 to 157 in 75f1d47
The RegExp constructor is exported as
exports["RegExp#constructor"]
with a signature of(this_: RegExp, regex: string, flags: string) => RegExp
(all pointers, thethis_
argument is typically0
to indicate that the ctor should allocate on its own, i.e. not asuper()
call). During demangling, the loader creates a functionexports.RegExp
one can use with and withoutnew
representing it, and one can invokenew exports.RegExp(regexPtr, flagsPtr)
(withoutthis_
) effectively corresponding toexports.createRegExp(regexPtr, flagsPtr)
, but returning a wrapper class instead of just a pointer.There may be value in exposing
createRegExp
, though, for where the loader is not used, i.e. when running the binary in a C or Rust host. The AS compiler typically does this to also provide an easy to use C-like interface that works everywhere.The text was updated successfully, but these errors were encountered: