mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Fixing bug #103351 - using undefined as RegExp value for String.replace.
r=khanson, sr=brendan
This commit is contained in:
parent
58e4856539
commit
3cafa8d101
@ -1064,9 +1064,6 @@ match_or_replace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||
if (JSVAL_IS_REGEXP(cx, argv[0])) {
|
||||
reobj = JSVAL_TO_OBJECT(argv[0]);
|
||||
re = (JSRegExp *) JS_GetPrivate(cx, reobj);
|
||||
} else {
|
||||
if (JSVAL_IS_VOID(argv[0])) {
|
||||
re = js_NewRegExp(cx, NULL, cx->runtime->emptyString, 0, JS_FALSE);
|
||||
} else {
|
||||
src = js_ValueToString(cx, argv[0]);
|
||||
if (!src)
|
||||
@ -1080,7 +1077,6 @@ match_or_replace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||
opt = NULL;
|
||||
}
|
||||
re = js_NewRegExpOpt(cx, NULL, src, opt, forceFlat);
|
||||
}
|
||||
if (!re)
|
||||
return JS_FALSE;
|
||||
reobj = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user