Version: (using KDE KDE 3.5.2) Installed from: Ubuntu Packages There are javascript tests at http://mochikit.com/tests/index.html, which Konqueror does not pass all. MochiKit is "a leightweight javascript framework" and I've added a bug in their tracker, but it seems to be with Konqueror. See http://trac.mochikit.com/ticket/93
Can't confirm the problem
Just tried it again, after disabling Privoxy, which I use as a proxy, but the same number of test fails. I assume you're using the same Konqueror version? Should I take the bug over to Kubuntu?
I am using post-3.5.2 3.5 branch, so not quite the same version...
Passes all tests here too. KDE 3.5 SVN.
Could not get verified on #kubuntu with x86 on amd64 (like my system), too (though with Dapper beta 2 and I'm using the current one). Someone on x86 also experienced the same problem. Nearly all tests are "decimal related": not ok - 1.23 JSON got "1", expected "1.23" not ok - array JSON got "[1, \"2\", 3]", expected "[1, \"2\", 3.3]" not ok - truncToFixed truncate got "0.000", expected "0.123" not ok - truncToFixed trailing zeros got "0.000", expected "0.120" not ok - truncToFixed no round got "0.0", expected "0.1" [...] not ok - custom locale got "2 apples and 300 bagels at 0am for breakfast", expected "2 apples and 345 bagels at 8am for breakfast" not ok - fromRGB < 16 works got "#e20fb6", expected "#e210b6"
It's related to LANG. When I start Konqueror with: LANG=C konqueror all tests pass. LANG is set to de_DE.UTF8 normally (and with the other person where the tests have failed).
Great detective work, thanks!
You're welcome. More strange: "LANG=C konqueror" does not fix it with the other person's setup, where it fails. But the failing tests are the same. At least that's what he said.
And trying to force your locale here doesn't trigger it :-(, nor can I see anything locale-specific happening on the path.. Could you perhaps do this experiment: enable the javascript debugger, run the tests. Pull up the debbugger window (View -> JavaScript debugger), click on the right-most icon in the toolbar. Then go to webpage, and click one of the report lines, so some JS runs and makes the debugger attach. At the bottom of the debugger window, there is a console. Type in: serializeJSON(1.23) and please paste the output here.. Also, typeof serializeJSON(1.23) may be interesting...
serializeJSON(1.23) 1 typeof serializeJSON(1.23) string btw: I had the debugger already enabled, but should not make any difference.
Wow. and what happens with: 1.23 + "" and String(1.23)?
.. and I just realized I may be looking at it from the wrong direction. Could you perhaps also test: 1.23 + 2 Number("1.23") Number("1.29")? thanks...
1.23 + "" 1 String(1.23) 1 1.23 + 2 3 Number("1.23") 1.23 Number("1.29") 1.29
FWIW I am testing with tr_TR.UTF-8 here and all test passes.
Aha, this came up again in a private conversation, and I see that the lexer is using strtod, which is locale-sensitive. The relevant setting is LC_NUMERIC....
SVN commit 572947 by orlovich: Fix locale-dependence in the parser. Thanks to Fredrik Johansson for reminding me of it and testing the fix. BUG:126482 M +2 -1 lexer.cpp --- branches/KDE/3.5/kdelibs/kjs/lexer.cpp #572946:572947 @@ -39,6 +39,7 @@ #include "identifier.h" #include "lookup.h" #include "internal.h" +#include "dtoa.h" // we can't specify the namespace in yacc's C output, so do it here using namespace KJS; @@ -453,7 +454,7 @@ long double dval = 0; if (state == Number) { - dval = strtod(buffer8, 0L); + dval = kjs_strtod(buffer8, 0L); } else if (state == Hex) { // scan hex numbers dval = 0; if (buffer8[0] == '0' && (buffer8[1] == 'x' || buffer8[1] == 'X')) {