Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: src/extensions/i18n/number-format.js

Issue 22266009: Move i18n's number-format C++ code to runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/extensions/i18n/number-format.cc ('k') | src/i18n.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/extensions/i18n/number-format.js
diff --git a/src/extensions/i18n/number-format.js b/src/extensions/i18n/number-format.js
index 1cd3db13554b245a4cdde7e47010df513b737f1e..5722a5dc1f3cfc47c2ab8d19a345cff5d386c3c8 100644
--- a/src/extensions/i18n/number-format.js
+++ b/src/extensions/i18n/number-format.js
@@ -65,8 +65,6 @@ function getNumberOption(options, property, min, max, fallback) {
* Useful for subclassing.
*/
function initializeNumberFormat(numberFormat, locales, options) {
- native function NativeJSCreateNumberFormat();
-
if (numberFormat.hasOwnProperty('__initializedIntlObject')) {
throw new TypeError('Trying to re-initialize NumberFormat object.');
}
@@ -148,9 +146,9 @@ function initializeNumberFormat(numberFormat, locales, options) {
if (internalOptions.hasOwnProperty('maximumSignificantDigits')) {
defineWEProperty(resolved, 'maximumSignificantDigits', undefined);
}
- var formatter = NativeJSCreateNumberFormat(requestedLocale,
- internalOptions,
- resolved);
+ var formatter = %CreateNumberFormat(requestedLocale,
+ internalOptions,
+ resolved);
// We can't get information about number or currency style from ICU, so we
// assume user request was fulfilled.
@@ -269,15 +267,13 @@ function initializeNumberFormat(numberFormat, locales, options) {
* NumberFormat.
*/
function formatNumber(formatter, value) {
- native function NativeJSInternalNumberFormat();
-
// Spec treats -0 and +0 as 0.
var number = Number(value);
if (number === -0) {
number = 0;
}
- return NativeJSInternalNumberFormat(formatter.formatter, number);
+ return %InternalNumberFormat(formatter.formatter, number);
}
@@ -285,9 +281,7 @@ function formatNumber(formatter, value) {
* Returns a Number that represents string value that was passed in.
*/
function parseNumber(formatter, value) {
- native function NativeJSInternalNumberParse();
-
- return NativeJSInternalNumberParse(formatter.formatter, String(value));
+ return %InternalNumberParse(formatter.formatter, String(value));
}
« no previous file with comments | « src/extensions/i18n/number-format.cc ('k') | src/i18n.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698