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

Unified Diff: src/runtime/runtime-i18n.cc

Issue 1973183002: Override Date.prototype.to*String with Intl.DateTimeFormat.format Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased 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/js/i18n.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index afa9cc849fe78b8678d022b5c62fde4434ea437b..f7dbe8a462d0e999d87613cbcfa26d23d69a9a8e 100644
--- a/src/runtime/runtime-i18n.cc
+++ b/src/runtime/runtime-i18n.cc
@@ -471,6 +471,27 @@ bool AddElement(Handle<JSArray> array, int index, int32_t field_id,
return true;
}
+#if 0
+RUNTIME_FUNCTION(Runtime_UpdateTimezoneInDateFormat) {
+ HandleScope scope(isolate);
+
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, date_format_holder, 0);
+
+ // TODO(jshin): Updating the timezone of |date_format| everytime cached
+ // DateFormat is used is not optimal. date_format_holder can be
+ // changed to store DATE_CACHE_VERSION and update the timezone in
+ // |date_format| only when the stored DATE_CACHE_VERSION is different from
+ // the current DATE_CACHE_VERSION.
+ icu::SimpleDateFormat* date_format =
+ DateFormat::UnpackDateFormat(isolate, date_format_holder);
+ if (!date_format) return isolate->ThrowIllegalOperation();
+
+ date_format->adoptTimeZone(icu::TimeZone::createDefault());
+ return isolate->heap()->true_value();
+}
+#endif
+
} // namespace
RUNTIME_FUNCTION(Runtime_InternalDateFormatToParts) {
« no previous file with comments | « src/js/i18n.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698