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

git-svn-id: svn://10.0.0.236/trunk@193397 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%mozilla.org
2006-04-02 19:08:47 +00:00
parent 695eb8839f
commit f7c113ea4f

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;