From 5dc1c91c1fc8358f33d0027028727e2df24ba1a6 Mon Sep 17 00:00:00 2001 From: Norbert Lindenberg Date: Wed, 27 Mar 2013 08:40:00 +0100 Subject: [PATCH] Bug 853075 - Remove workarounds. r=tschneidereit --HG-- extra : rebase_source : baf38de8ba1e05411e1b0a5276610e3cf931daa8 --- js/src/jsdate.cpp | 22 +++++++++------------- js/src/jsnum.cpp | 12 ++++-------- js/src/jsstr.cpp | 14 +++++--------- 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 7d1c29a74f1..ca9cd80e0a4 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -3032,18 +3032,6 @@ static JSFunctionSpec date_methods[] = { JS_FN("setUTCMilliseconds", date_setUTCMilliseconds, 1,0), JS_FN("toUTCString", date_toGMTString, 0,0), JS_FN("toLocaleFormat", date_toLocaleFormat, 0,0), - JS_FN("toDateString", date_toDateString, 0,0), - JS_FN("toTimeString", date_toTimeString, 0,0), - JS_FN("toISOString", date_toISOString, 0,0), - JS_FN(js_toJSON_str, date_toJSON, 1,0), -#if JS_HAS_TOSOURCE - JS_FN(js_toSource_str, date_toSource, 0,0), -#endif - JS_FN(js_toString_str, date_toString, 0,0), - JS_FN(js_valueOf_str, date_valueOf, 0,0), - - // This must be at the end because of bug 853075: functions listed after - // self-hosted methods aren't available in self-hosted code. #if ENABLE_INTL_API {js_toLocaleString_str, {NULL, NULL}, 0,0, "Date_toLocaleString"}, {"toLocaleDateString", {NULL, NULL}, 0,0, "Date_toLocaleDateString"}, @@ -3053,7 +3041,15 @@ static JSFunctionSpec date_methods[] = { JS_FN("toLocaleDateString", date_toLocaleDateString, 0,0), JS_FN("toLocaleTimeString", date_toLocaleTimeString, 0,0), #endif - + JS_FN("toDateString", date_toDateString, 0,0), + JS_FN("toTimeString", date_toTimeString, 0,0), + JS_FN("toISOString", date_toISOString, 0,0), + JS_FN(js_toJSON_str, date_toJSON, 1,0), +#if JS_HAS_TOSOURCE + JS_FN(js_toSource_str, date_toSource, 0,0), +#endif + JS_FN(js_toString_str, date_toString, 0,0), + JS_FN(js_valueOf_str, date_valueOf, 0,0), JS_FS_END }; diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index 464a90e1084..74bead2c1b5 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -894,19 +894,15 @@ static JSFunctionSpec number_methods[] = { JS_FN(js_toSource_str, num_toSource, 0, 0), #endif JS_FN(js_toString_str, num_toString, 1, 0), - JS_FN(js_valueOf_str, js_num_valueOf, 0, 0), - JS_FN("toFixed", num_toFixed, 1, 0), - JS_FN("toExponential", num_toExponential, 1, 0), - JS_FN("toPrecision", num_toPrecision, 1, 0), - - // This must be at the end because of bug 853075: functions listed after - // self-hosted methods aren't available in self-hosted code. #if ENABLE_INTL_API {js_toLocaleString_str, {NULL, NULL}, 0,0, "Number_toLocaleString"}, #else JS_FN(js_toLocaleString_str, num_toLocaleString, 0,0), #endif - + JS_FN(js_valueOf_str, js_num_valueOf, 0, 0), + JS_FN("toFixed", num_toFixed, 1, 0), + JS_FN("toExponential", num_toExponential, 1, 0), + JS_FN("toPrecision", num_toPrecision, 1, 0), JS_FS_END }; diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index dcc4352d521..f20af7d4baf 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -3376,6 +3376,11 @@ static JSFunctionSpec string_methods[] = { JS_FN("trimRight", str_trimRight, 0,JSFUN_GENERIC_NATIVE), JS_FN("toLocaleLowerCase", str_toLocaleLowerCase, 0,JSFUN_GENERIC_NATIVE), JS_FN("toLocaleUpperCase", str_toLocaleUpperCase, 0,JSFUN_GENERIC_NATIVE), +#if ENABLE_INTL_API + {"localeCompare", {NULL, NULL}, 1,0, "String_localeCompare"}, +#else + JS_FN("localeCompare", str_localeCompare, 1,JSFUN_GENERIC_NATIVE), +#endif /* Perl-ish methods (search is actually Python-esque). */ JS_FN("match", str_match, 1,JSFUN_GENERIC_NATIVE), @@ -3406,15 +3411,6 @@ static JSFunctionSpec string_methods[] = { #endif JS_FN("iterator", JS_ArrayIterator, 0,0), - - // This must be at the end because of bug 853075: functions listed after - // self-hosted methods aren't available in self-hosted code. -#if ENABLE_INTL_API - {"localeCompare", {NULL, NULL}, 1,0, "String_localeCompare"}, -#else - JS_FN("localeCompare", str_localeCompare, 1,JSFUN_GENERIC_NATIVE), -#endif - JS_FS_END };