obj[ key ] = val;
} : function ( obj, key, val, msg ) {
msg = 'Use of "' + key + '" is deprecated.' + ( msg ? ( ' ' + msg ) : '' );
- // Support: IE8
- // Can throw on Object.defineProperty.
- try {
- Object.defineProperty( obj, key, {
- configurable: true,
- enumerable: true,
- get: function () {
- mw.track( 'mw.deprecate', key );
- mw.log.warn( msg );
- return val;
- },
- set: function ( newVal ) {
- mw.track( 'mw.deprecate', key );
- mw.log.warn( msg );
- val = newVal;
- }
- } );
- } catch ( err ) {
- // Fallback to creating a copy of the value to the object.
- obj[ key ] = val;
- }
+ Object.defineProperty( obj, key, {
+ configurable: true,
+ enumerable: true,
+ get: function () {
+ mw.track( 'mw.deprecate', key );
+ mw.log.warn( msg );
+ return val;
+ },
+ set: function ( newVal ) {
+ mw.track( 'mw.deprecate', key );
+ mw.log.warn( msg );
+ val = newVal;
+ }
+ } );
+
};
return log;
// Whether the store is in use on this page.
enabled: null,
- // Modules whose string representation exceeds 100 kB are ineligible
- // for storage due to bug T66721.
- MODULE_SIZE_MAX: 100000,
+ // Modules whose string representation exceeds 100 kB (30 kB on FF) are
+ // ineligible for storage due to bug T66721. The quota is stricter on
+ // Firefox due to <https://bugzilla.mozilla.org/show_bug.cgi?id=1064466>.
+ MODULE_SIZE_MAX: ( /Firefox/.test( navigator.userAgent ) ? 30 : 100 ) * 1000,
// The contents of the store, mapping '[module name]@[version]' keys
// to module implementations.
};
}() ),
- // Skeleton user object. mediawiki.user.js extends this
+ // Skeleton user object, extended by the 'mediawiki.user' module.
+ /**
+ * @class mw.user
+ * @singleton
+ */
user: {
+ /**
+ * @property {mw.Map}
+ */
options: new Map(),
+ /**
+ * @property {mw.Map}
+ */
tokens: new Map()
},