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

Unified Diff: src/i18n.js

Issue 255273004: Remove duplicate ToObject implementaion from i18n. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.js
diff --git a/src/i18n.js b/src/i18n.js
index edfb065c9c998afd12ec059c04b30532289592bb..1f087dc41159c42a1f89b6d4070e360619a8b38e 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -302,7 +302,7 @@ function supportedLocalesOf(service, locales, options) {
if (options === undefined) {
options = {};
} else {
- options = toObject(options);
+ options = ToObject(options);
}
var matcher = options.localeMatcher;
@@ -536,18 +536,6 @@ function parseExtension(extension) {
/**
- * Converts parameter to an Object if possible.
- */
-function toObject(value) {
- if (IS_NULL_OR_UNDEFINED(value)) {
- throw new $TypeError('Value cannot be converted to an Object.');
- }
-
- return $Object(value);
-}
-
-
-/**
* Populates internalOptions object with boolean key-value pairs
* from extensionMap and options.
* Returns filtered extension (number and date format constructors use
@@ -776,7 +764,7 @@ function initializeLocaleList(locales) {
return freezeArray(seen);
}
- var o = toObject(locales);
+ var o = ToObject(locales);
// Converts it to UInt32 (>>> is shr on 32bit integers).
var len = o.length >>> 0;
@@ -988,7 +976,7 @@ function initializeCollator(collator, locales, options) {
return new Intl.Collator(locales, options);
}
- return initializeCollator(toObject(this), locales, options);
+ return initializeCollator(ToObject(this), locales, options);
},
DONT_ENUM
);
@@ -1215,7 +1203,7 @@ function initializeNumberFormat(numberFormat, locales, options) {
return new Intl.NumberFormat(locales, options);
}
- return initializeNumberFormat(toObject(this), locales, options);
+ return initializeNumberFormat(ToObject(this), locales, options);
},
DONT_ENUM
);
@@ -1468,7 +1456,7 @@ function toDateTimeOptions(options, required, defaults) {
if (options === undefined) {
options = null;
} else {
- options = toObject(options);
+ options = ToObject(options);
}
options = $Object.apply(this, [options]);
@@ -1610,7 +1598,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
return new Intl.DateTimeFormat(locales, options);
}
- return initializeDateTimeFormat(toObject(this), locales, options);
+ return initializeDateTimeFormat(ToObject(this), locales, options);
},
DONT_ENUM
);
@@ -1816,7 +1804,7 @@ function initializeBreakIterator(iterator, locales, options) {
return new Intl.v8BreakIterator(locales, options);
}
- return initializeBreakIterator(toObject(this), locales, options);
+ return initializeBreakIterator(ToObject(this), locales, options);
},
DONT_ENUM
);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698