Number.toString does not throw exceptions like it should Patch to fix this coming up.
Created attachment 18180 [details] Reviewed by Sam. Update Number.toString to properly throw exceptions. Cleanup code in Number.toString implementation. * kjs/number_object.cpp: (KJS::numberToString): * kjs/object.cpp: (KJS::Error::create): Remove bogus debug lines. --- JavaScriptCore/ChangeLog | 12 +++ JavaScriptCore/kjs/number_object.cpp | 100 +++++++++++--------- JavaScriptCore/kjs/object.cpp | 12 --- LayoutTests/ChangeLog | 13 +++ .../fast/js/number-toExponential-expected.txt | 12 ++- LayoutTests/fast/js/number-toExponential.html | 13 +++ LayoutTests/fast/js/number-toString-expected.txt | 25 +++--- LayoutTests/fast/js/resources/number-toString.js | 1 + 8 files changed, 114 insertions(+), 74 deletions(-)
Comment on attachment 18180 [details] Reviewed by Sam. This can be move up a little to return a little earlier. + double x = v->toNumber(exec); + if (isnan(x) || isinf(x)) + return jsString(UString::from(x)); The change to object.cpp seems unrelated. We should also test toString() with a fractional argument. r=me
r29036