jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/349085 )

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
(cherry picked from commit 7b2da95a9814beb05112ea2860433499967ab1b9)
---
M resources/src/startup.js
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



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/349085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I34bbe8edf6e9625f8d80f829707adafcb1b91980
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.29.0-wmf.20
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to