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

Unified Diff: src/js/i18n.js

Issue 2623683002: [intl] Remove redundant type checking system (Closed)
Patch Set: Created 3 years, 11 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/i18n.cc ('k') | src/runtime/runtime-i18n.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/i18n.js
diff --git a/src/js/i18n.js b/src/js/i18n.js
index 18d13db9a2c2f96e88f2c96305486ec7cb933cc9..4ee4733cb90bf3fe27b85536872db7ca076f51af 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -1747,6 +1747,11 @@ function FormatDateToParts(dateValue) {
if (!IS_OBJECT(this)) {
throw %make_type_error(kCalledOnNonObject, this);
}
+ if (!%IsInitializedIntlObjectOfType(this, 'dateformat')) {
+ throw %make_type_error(kIncompatibleMethodReceiver,
+ 'Intl.DateTimeFormat.prototype.formatToParts',
+ this);
+ }
var dateMs;
if (IS_UNDEFINED(dateValue)) {
dateMs = %DateCurrentTime();
« no previous file with comments | « src/i18n.cc ('k') | src/runtime/runtime-i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698