mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Fixed document.writeln problem from http://www.legomindspring.com
This commit is contained in:
parent
6b961a05d4
commit
67406f8fe7
@ -737,22 +737,21 @@ nsHTMLDocument::Write(JSContext *cx, jsval *argv, PRUint32 argc)
|
||||
|
||||
if (argc > 0) {
|
||||
PRUint32 index;
|
||||
nsAutoString str;
|
||||
for (index = 0; index < argc; index++) {
|
||||
nsAutoString str;
|
||||
JSString *jsstring = JS_ValueToString(cx, argv[index]);
|
||||
|
||||
if (nsnull != jsstring) {
|
||||
str.SetString(JS_GetStringChars(jsstring));
|
||||
str.Append(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
str.SetString(""); // Should this really be null??
|
||||
}
|
||||
|
||||
result = mParser->Parse(str, PR_TRUE);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
str.Append(""); // Should this really be null??
|
||||
}
|
||||
}
|
||||
result = mParser->Parse(str, PR_TRUE);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -737,22 +737,21 @@ nsHTMLDocument::Write(JSContext *cx, jsval *argv, PRUint32 argc)
|
||||
|
||||
if (argc > 0) {
|
||||
PRUint32 index;
|
||||
nsAutoString str;
|
||||
for (index = 0; index < argc; index++) {
|
||||
nsAutoString str;
|
||||
JSString *jsstring = JS_ValueToString(cx, argv[index]);
|
||||
|
||||
if (nsnull != jsstring) {
|
||||
str.SetString(JS_GetStringChars(jsstring));
|
||||
str.Append(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
str.SetString(""); // Should this really be null??
|
||||
}
|
||||
|
||||
result = mParser->Parse(str, PR_TRUE);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
str.Append(""); // Should this really be null??
|
||||
}
|
||||
}
|
||||
result = mParser->Parse(str, PR_TRUE);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user