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

Unified Diff: src/js/i18n.js

Issue 1985423003: Invalidate defaultObjects if timezone changes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes after review Created 4 years, 7 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 | src/runtime/runtime.h » ('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 b3a0f5b6ebd1783b8b884c462f207b82bcaf8cff..994c2328019f0fe5705ea0905479f4e17bd7ee73 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -1989,6 +1989,23 @@ var defaultObjects = {
'dateformattime': UNDEFINED,
};
+function clearDefaultObjects() {
+ defaultObjects['dateformatall'] = UNDEFINED;
+ defaultObjects['dateformatdate'] = UNDEFINED;
+ defaultObjects['dateformattime'] = UNDEFINED;
+}
+
+var date_cache_version = 0;
+
+function checkDateCacheCurrent() {
+ var new_date_cache_version = %DateCacheVersion();
+ if (new_date_cache_version == date_cache_version) {
+ return;
+ }
+ date_cache_version = new_date_cache_version;
+
+ clearDefaultObjects();
+}
/**
* Returns cached or newly created instance of a given service.
@@ -1997,6 +2014,7 @@ var defaultObjects = {
function cachedOrNewService(service, locales, options, defaults) {
var useOptions = (IS_UNDEFINED(defaults)) ? options : defaults;
if (IS_UNDEFINED(locales) && IS_UNDEFINED(options)) {
+ checkDateCacheCurrent();
if (IS_UNDEFINED(defaultObjects[service])) {
defaultObjects[service] = new savedObjects[service](locales, useOptions);
}
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698