Undepend regexp source string so error message formatted arg refs into it work (332472, r=mrbkap).

This commit is contained in:
brendan%mozilla.org 2006-04-02 19:07:49 +00:00
parent 878a413555
commit daee041a64

View File

@ -1927,7 +1927,10 @@ js_NewRegExp(JSContext *cx, JSTokenStream *ts,
state.context = cx;
state.tokenStream = ts;
state.cpbegin = state.cp = JSSTRING_CHARS(str);
state.cp = js_UndependString(cx, str);
if (!state.cp)
goto out;
state.cpbegin = state.cp;
state.cpend = state.cp + len;
state.flags = flags;
state.parenCount = 0;