mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 519926. When the string is an optional argument and isn't passed, pval is null. r=jorendorff
This commit is contained in:
parent
ba826e31ee
commit
c42718629c
@ -20,6 +20,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478251
|
||||
|
||||
/** Test for Bug 478251 **/
|
||||
var doc = $("t").contentDocument;
|
||||
doc.open();
|
||||
doc.write();
|
||||
doc.close();
|
||||
is(doc.documentElement.textContent, "", "Writing || failed");
|
||||
|
||||
doc.open();
|
||||
doc.write(null);
|
||||
doc.close();
|
||||
@ -40,6 +45,11 @@ doc.write(undefined, undefined);
|
||||
doc.close();
|
||||
is(doc.documentElement.textContent, "undefinedundefined", "Writing |undefined, undefined| failed");
|
||||
|
||||
doc.open();
|
||||
doc.writeln();
|
||||
doc.close();
|
||||
is(doc.documentElement.textContent, "\n", "Writing |\\n| failed");
|
||||
|
||||
doc.open();
|
||||
doc.writeln(null);
|
||||
doc.close();
|
||||
|
@ -704,10 +704,15 @@ xpc_qsDOMString::xpc_qsDOMString(JSContext *cx, jsval v, jsval *pval,
|
||||
behavior = undefinedBehavior;
|
||||
}
|
||||
|
||||
if (behavior != eStringify)
|
||||
// If pval is null, that means the argument was optional and
|
||||
// not passed; turn those into void strings if they're
|
||||
// supposed to be stringified.
|
||||
if (behavior != eStringify || !pval)
|
||||
{
|
||||
// Here behavior == eStringify implies !pval, so both eNull and
|
||||
// eStringify should end up with void strings.
|
||||
(new(mBuf) implementation_type(
|
||||
traits::sEmptyBuffer, PRUint32(0)))->SetIsVoid(behavior == eNull);
|
||||
traits::sEmptyBuffer, PRUint32(0)))->SetIsVoid(behavior != eEmpty);
|
||||
mValid = JS_TRUE;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user