Closed simeonmiteff closed 9 months ago
It would be one-way (no JS->Zeek) and just stringify the pattern (I don't think conversion to a JS RegExp object is feasible).
Yeah, that seems fine. If someone really wants to have a RegExp
they can try to construct it in JS from the string. I do wonder if the JS -> Zeek route should work though.
Did you have a use-cases, or was that from poking at global_ids()
? :-)
Yeah, that seems fine. If someone really wants to have a RegExp they can try to construct it in JS from the string. I do wonder if the JS -> Zeek route should work though.
Ok, I'll look into JS -> Zeek.
Did you have a use-cases, or was that from poking at global_ids()? :-)
Sort of: the poking at global_ids()
was in persuit of another goal that would also benefit from having more Zeek and JS types being convertable to eachother. So, the use case is not even half-baked yet. I figured this would be low priority hence I'm happy to hack at it on my own and open a PR when it works. Happy to close this issue if you prefer.
Would this make any sense?
It would be one-way (no JS->Zeek) and just stringify the pattern (I don't think conversion to a JS
RegExp
object is feasible).Alternatively, is it possible/desireable to throw a JS exception instread of the
eprintf()
and returningv8::Null
(as this would make handling unsupported type errors explicit in JS-land)?