weirdal: you'll get to learn all about jsrooting * WeirdAl cries have a rootcanal first, then try it but seriously, it shouldn't be /too/ hard -->| sicking_ (chatzilla@moz-C9AA1F4F.hsd1.ca.comcast.net) has joined #developers you can try using jsd_xpc as an example basically you'll need your own js context, and an xpcom interface for regexps then you basically start a request, setup a root, create the regexp, make sure it succeeded, don't lose your root, finish your request =-= smontaguAway is now known as smontagu when someone wants to use your regexp, you start a request, setup a root, create a script, make sure it succeeded, call your script, make sure not to lose your result, spend a lot of effort proxying the result, end your request, return your proxy probably want to eventually discard your root on the script, preferably before you end your request note that before you start a request, you need to create a jscontext -->| bent (chatzilla-@D140E19A.77FDD0CA.17689BFA.IP) has joined #developers and when your xpcom object dies, preferably before js dies, you want to destroy your context (preferably dropping your root to the regexp first) that's about it rootcanal sounds like it describes the problem pretty well simple, and it shouldn't need more than 2000 lines * timeless shrugs I'm going to save that text - it'll come in handy for me later =-= dria-afk is now known as dria wouldn't it be nicer if JS exposed a C API for this>? biesi: that's what I thought they did, via JS_NewRegExpObject that's why I asked about it it'd be hard to expose a C API for it but it's been requested WeirdAl, that probably just creates a JSObject a c api wouldn't really help most xpcom consumers (you need a context to run it on, objects initialized, etc.) i think i saw a patch, using JS regexes from a c++ component long time ago timeless, well an xpcom component would wrap that C api |<-- IRCMonkey3047300 has left moznet (Quit: IRCMonkey3047300) trying to add regex blocking to the image blocker biesi: what i described does that shaver, hm, ok mvl: I found this via Google: http://www.cps.msu.edu/~dunham/hacks/mozilla-1.2.patch and replaces can run JS functions e.t.c. maybe easier to make a JS component that implements regexes although for schema validation, I just wrote a js xpcom component ideally it would have a new context per regex to avoid side-effects from previous ones affecting new ones the constructor would have to be magical biesi: evalInSandbox, create a new sandbox each time? it's possible for a factory to do the right thing but definitely non trivial WeirdAl, oh, that would probably work, yeah -->| bsmedberg (chatzilla@moz-65155D2C.fa1-0-2.occ.iinet.com) has joined #developers -->| analogAI (analogAI@moz-360B2CB2.san.res.rr.com) has joined #developers or just delete the values WeirdAl, and replaces can run JS functions * timeless sighs sounds like regexes can therefore do anything biesi: yep replaces can regexes aren't replaces in JS * Hannibal finally has a use for a JS 1.7 feature, but now has to think of how to design his code so it doesn't need that. oh yeah replace is an operation that takes a regex as an operand Hannibal: why? * biesi is too tired to pay attention :/ hannibal: you want to crash? timeless really needs more work to do because Firebug right now needs to work on Fx 1.5 as well? I suppose so... and that doesn't have js 1.7 does this feature need to work with 1.5? :) anyway mvl: that patch isn't very safe I'm getting in your way for starters, it doesn't do any rooting which is not _technically_ the job of the mentor that's ok. timeless: i never really looked at the patch heh. so timeless, shaver: an XPCOM API would be preferable over calling into a JS-based component, yes? weirdal: um ? i so didn't say that aren't those two the same? an xpcom api doesn't specify what language implements it XPCOM is how you would call into a JS-based component or how many impls there are ok, so what I said made no sense i just happened to describe how you'd do it from c++ i don't know how to do it from js because i don't speak sandbox i've tried a couple of times and never gotten it right well, the sandbox api seems to change every other week too :) in that case, let me rephrase: because I'm doing this from content code, do I want to write the component in JS or in C++? it didn't help that when i tried to weirdal: you don't want to try to use the c apis rooting is hard, even for the spidermonkey devs -->| Peter6 (Peter6@2521AAD9.3852C170.3D5584FB.IP) has joined #developers it didn't help that when i tried to ... use sandboxes, what i wanted to do wasn't even possible :) i think it might be now,.. well, I know how to use sandboxes so the only problem you have left is the xpcom api if you're lucky, dmose and co left one in a bug =-= sheppy is now known as sheppy-afk so now I need to search for said bug okay, thanks :)