From 58aa626fc71db47e3530299b9a1f4539d8615b10 Mon Sep 17 00:00:00 2001 From: "dglazkov@chromium.org" Date: Thu, 12 Mar 2009 19:34:02 +0000 Subject: WebCore: 2009-03-12 Dimitri Glazkov Reviewed by Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=24496 Fix console logging of non-string values by coercing the argument to a string. Test: fast/js/console-non-string-values.html * bindings/js/ScriptValue.cpp: Removed PlatformString include. * bindings/js/ScriptValue.h: Added toString method. (WebCore::ScriptValue::toString): * page/Console.cpp: (WebCore::getFirstArgumentAsString): Changed firstArgumentAsString method to use ScriptValue::toString. (WebCore::Console::addMessage): added extra ScriptState argument to callsite. (WebCore::Console::count): Ditto. LayoutTests: 2009-03-12 Simon Fraser Reviewed by Dimitri Glazkov. https://bugs.webkit.org/show_bug.cgi?id=24496 Test for logging non-string values. * fast/js/console-non-string-values-expected.txt: Added. * fast/js/console-non-string-values.html: Added. git-svn-id: svn://svn.chromium.org/blink/trunk@41640 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- .../fast/js/console-non-string-values-expected.txt | 7 +++++++ .../LayoutTests/fast/js/console-non-string-values.html | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 third_party/WebKit/LayoutTests/fast/js/console-non-string-values-expected.txt create mode 100644 third_party/WebKit/LayoutTests/fast/js/console-non-string-values.html (limited to 'third_party/WebKit/LayoutTests/fast/js') diff --git a/third_party/WebKit/LayoutTests/fast/js/console-non-string-values-expected.txt b/third_party/WebKit/LayoutTests/fast/js/console-non-string-values-expected.txt new file mode 100644 index 0000000..ffd0fe8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/js/console-non-string-values-expected.txt @@ -0,0 +1,7 @@ +CONSOLE MESSAGE: line 0: I am a string +CONSOLE MESSAGE: line 0: 42 +Should see two console messages, the first a string, and the second a number. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/js/console-non-string-values.html b/third_party/WebKit/LayoutTests/fast/js/console-non-string-values.html new file mode 100644 index 0000000..b11861f --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/js/console-non-string-values.html @@ -0,0 +1,18 @@ + + + + + + + +

+
+ + + + -- cgit v1.1