2008-06-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
[WebKit-https.git] / JavaScriptCore / kjs / testkjs.cpp
index 9ebc7f32c439d060a5db714148f0813a387cf1dd..09adbc53ca9fae1a6b9bec84cd5e39056cd9eb02 100644 (file)
@@ -159,7 +159,11 @@ GlobalObject::GlobalObject(Vector<UString>& arguments)
 
 JSValue* functionPrint(ExecState* exec, JSObject*, const List& args)
 {
-    printf("%s\n", args[0]->toString(exec).UTF8String().c_str());
+    if (!args.isEmpty())
+        printf("%s\n", args[0]->toString(exec).UTF8String().c_str());
+    else
+        putchar('\n');
+    
     fflush(stdout);
     return jsUndefined();
 }