Krinkle has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/348856 )
Change subject: resourceloader: Move mwNow() to after isCompatible()
......................................................................
resourceloader: Move mwNow() to after isCompatible()
Follows-up f2fb4a21af. This is logically still the same point in time.
Only 1 function before it now, isCompatible(), which is fine since it
is small and the variable is not used anyway if it returns false.
Change-Id: I34bbe8edf6e9625f8d80f829707adafcb1b91980
---
M resources/src/startup.js
1 file changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/56/348856/1
diff --git a/resources/src/startup.js b/resources/src/startup.js
index ad06b34..e0df772 100644
--- a/resources/src/startup.js
+++ b/resources/src/startup.js
@@ -1,7 +1,8 @@
/**
- * Code in this file MUST work on even the most ancient of browsers!
+ * This file is where we decide whether to initialise the Grade A run-time.
*
- * This file is where we decide whether to initialise the modern run-time.
+ * - Beware: This file MUST parse without errors on even the most ancient of
browsers!
+ * - Beware: Do not call mwNow before the isCompatible() check.
*/
/* global mw, $VARS, $CODE */
@@ -18,9 +19,7 @@
function () { return Date.now(); };
}() ),
// eslint-disable-next-line no-unused-vars
- mediaWikiLoadStart = mwNow();
-
-mwPerformance.mark( 'mwLoadStart' );
+ mediaWikiLoadStart;
/**
* See <https://www.mediawiki.org/wiki/Compatibility#Browsers>
@@ -153,6 +152,9 @@
};
}
+ mediaWikiLoadStart = mwNow();
+ mwPerformance.mark( 'mwLoadStart' );
+
script = document.createElement( 'script' );
script.src = $VARS.baseModulesUri;
script.onload = script.onreadystatechange = function () {
--
To view, visit https://gerrit.wikimedia.org/r/348856
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34bbe8edf6e9625f8d80f829707adafcb1b91980
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits