jenkins-bot has submitted this change and it was merged.
Change subject: rlfeature: Track use of json polyfill as fail, not pass.
......................................................................
rlfeature: Track use of json polyfill as fail, not pass.
Follows-up 8a81ece. We use JSON a fair bit (including in WikimediaEvents).
Chances are that by the time this code executes, any clients not supporting
it will have had the polyfill loaded by now.
Make sure we account for that.
Bug: T141344
Change-Id: Ic85a523972c11618563e6382db38da869a888825
(cherry picked from commit 6a7402372d9936dbff69d24375bf74c464a38a6d)
---
M modules/ext.wikimediaEvents.rlfeature.js
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ext.wikimediaEvents.rlfeature.js
b/modules/ext.wikimediaEvents.rlfeature.js
index 12727f3..fc9ab1d 100644
--- a/modules/ext.wikimediaEvents.rlfeature.js
+++ b/modules/ext.wikimediaEvents.rlfeature.js
@@ -27,7 +27,13 @@
// Task: https://phabricator.wikimedia.org/T141344
// Based on mediawiki-core:/resources/src/json-skip.js
- passJSON = !!( window.JSON && JSON.stringify && JSON.parse );
+ passJSON = !!( window.JSON && JSON.stringify && JSON.parse )
+ // Either 'json' isn't registered/loaded, or it is and it was
skipped
+ // If it was not skipped and the above JSON interface was
provided
+ // by the polyfill, consider client 'fail', not 'pass'
+ && ( !mw.loader.moduleRegistry.json
+ || mw.loader.moduleRegistry.json.skipped === true
+ );
if ( passJSON ) {
mw.track( 'counter.mw.js.support_json.pass', 1 );
--
To view, visit https://gerrit.wikimedia.org/r/303602
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic85a523972c11618563e6382db38da869a888825
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: wmf/1.28.0-wmf.13
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits