Fixed document.writeln problem from http://www.legomindspring.com

This commit is contained in:
vidur%netscape.com 1998-09-12 00:04:22 +00:00
parent 6b961a05d4
commit 67406f8fe7
2 changed files with 14 additions and 16 deletions

View File

@ -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;

View File

@ -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;