1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
This commit is contained in:
Kalle Olavi Niemitalo 2006-02-12 10:03:25 +02:00 committed by Kalle Olavi Niemitalo
commit 49b70d838b
3 changed files with 22 additions and 9 deletions

View File

@ -212,14 +212,21 @@ js_document_write_do(struct SEE_interpreter *interp, struct SEE_object *self,
struct string *ret = g->ret; struct string *ret = g->ret;
if (argc >= 1 && ret) { if (argc >= 1 && ret) {
unsigned char *code = SEE_value_to_unsigned_char(interp, argv[0]); int i = 0;
if (code) { for (; i < argc; ++i) {
add_to_string(ret, code); unsigned char *code;
mem_free(code);
if (newline) code = SEE_value_to_unsigned_char(interp, argv[i]);
add_char_to_string(ret, '\n');
if (code) {
add_to_string(ret, code);
mem_free(code);
}
} }
if (newline)
add_char_to_string(ret, '\n');
} }
#ifdef CONFIG_LEDS #ifdef CONFIG_LEDS
/* XXX: I don't know about you, but I have *ENOUGH* of those 'Undefined /* XXX: I don't know about you, but I have *ENOUGH* of those 'Undefined

View File

@ -212,9 +212,14 @@ document_write_do(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv,
struct string *ret = interpreter->ret; struct string *ret = interpreter->ret;
if (argc >= 1 && ret) { if (argc >= 1 && ret) {
unsigned char *code = jsval_to_string(ctx, &argv[0]); int i = 0;
for (; i < argc; ++i) {
unsigned char *code = jsval_to_string(ctx, &argv[i]);
add_to_string(ret, code);
}
add_to_string(ret, code);
if (newline) if (newline)
add_char_to_string(ret, '\n'); add_char_to_string(ret, '\n');
} }

View File

@ -3,7 +3,8 @@
<a href="history.html">history.html</a><br/> <a href="history.html">history.html</a><br/>
<script type="text/javascript"> <script type="text/javascript">
document.writeln('<a href="ontest.html">Test</a><br/>'); document.writeln('<a href="ontest.html">Test</a><br/>');
document.write('<a href="infinite2.html">infinite2.html</a><br/>'); document.writeln('<a href="infinite2.html">infinite2.html</a><br/>');
document.write(1,2,'3', '<br/>');
</script> </script>
<a href="onload.html">onload.html</a><br/> <a href="onload.html">onload.html</a><br/>
</body> </body>