Update OOjs to v2.2.0
authorJames D. Forrester <jforrester@wikimedia.org>
Tue, 3 Apr 2018 20:37:46 +0000 (13:37 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Tue, 3 Apr 2018 20:38:16 +0000 (13:38 -0700)
Release notes:
 https://gerrit.wikimedia.org/r/plugins/gitiles/oojs/core/+/v2.2.0/History.md

Change-Id: If2f673da4c2f6c1576620d96ed28ac4c538ba119

maintenance/resources/update-oojs.sh
resources/lib/oojs/oojs.jquery.js

index 267bd96..f99bb7d 100755 (executable)
@@ -52,7 +52,7 @@ COMMITMSG=$(cat <<END
 Update OOjs to v$OOJS_VERSION
 
 Release notes:
 Update OOjs to v$OOJS_VERSION
 
 Release notes:
- https://phabricator.wikimedia.org/diffusion/GOJS/browse/master/History.md;v$OOJS_VERSION
+ https://gerrit.wikimedia.org/r/plugins/gitiles/oojs/core/+/v$OOJS_VERSION/History.md
 END
 )
 
 END
 )
 
index 8cc6f11..b51c5d1 100644 (file)
@@ -1,18 +1,17 @@
 /*!
 /*!
- * OOjs v2.1.0 optimised for jQuery
+ * OOjs v2.2.0 optimised for jQuery
  * https://www.mediawiki.org/wiki/OOjs
  *
  * https://www.mediawiki.org/wiki/OOjs
  *
- * Copyright 2011-2017 OOjs Team and other contributors.
+ * Copyright 2011-2018 OOjs Team and other contributors.
  * Released under the MIT license
  * https://oojs.mit-license.org
  *
  * Released under the MIT license
  * https://oojs.mit-license.org
  *
- * Date: 2017-05-30T22:56:52Z
+ * Date: 2018-04-03T19:45:13Z
  */
 ( function ( global ) {
 
 'use strict';
 
  */
 ( function ( global ) {
 
 'use strict';
 
-/* exported toString */
 var
        /**
         * Namespace for all classes, static methods and static properties.
 var
        /**
         * Namespace for all classes, static methods and static properties.
@@ -22,6 +21,8 @@ var
        oo = {},
        // Optimisation: Local reference to Object.prototype.hasOwnProperty
        hasOwn = oo.hasOwnProperty,
        oo = {},
        // Optimisation: Local reference to Object.prototype.hasOwnProperty
        hasOwn = oo.hasOwnProperty,
+       // Marking this as "exported" doesn't work when parserOptions.sourceType is module
+       // eslint-disable-next-line no-unused-vars
        toString = oo.toString;
 
 /* Class Methods */
        toString = oo.toString;
 
 /* Class Methods */
@@ -87,12 +88,9 @@ oo.inheritClass = function ( targetFn, originFn ) {
 
        targetConstructor = targetFn.prototype.constructor;
 
 
        targetConstructor = targetFn.prototype.constructor;
 
-       // Using ['super'] instead of .super because 'super' is not supported
-       // by IE 8 and below (bug 63303).
-       // Provide .parent as alias for code supporting older browsers which
+       // [DEPRECATED] Provide .parent as alias for code supporting older browsers which
        // allows people to comply with their style guide.
        // allows people to comply with their style guide.
-       // eslint-disable-next-line dot-notation
-       targetFn[ 'super' ] = targetFn.parent = originFn;
+       targetFn.super = targetFn.parent = originFn;
 
        targetFn.prototype = Object.create( originFn.prototype, {
                // Restore constructor property of targetFn
 
        targetFn.prototype = Object.create( originFn.prototype, {
                // Restore constructor property of targetFn
@@ -263,7 +261,7 @@ oo.deleteProp = function ( obj ) {
        }
        delete prop[ arguments[ i ] ];
        // Walk back through props removing any plain empty objects
        }
        delete prop[ arguments[ i ] ];
        // Walk back through props removing any plain empty objects
-       while ( ( prop = props.pop() ) && oo.isPlainObject( prop ) && !Object.keys( prop ).length ) {
+       while ( props.length > 1 && ( prop = props.pop() ) && oo.isPlainObject( prop ) && !Object.keys( prop ).length ) {
                delete props[ props.length - 1 ][ arguments[ props.length ] ];
        }
 };
                delete props[ props.length - 1 ][ arguments[ props.length ] ];
        }
 };
@@ -394,9 +392,7 @@ oo.compare = function ( a, b, asymmetrical ) {
 
        for ( k in a ) {
                if ( !hasOwn.call( a, k ) || a[ k ] === undefined || a[ k ] === b[ k ] ) {
 
        for ( k in a ) {
                if ( !hasOwn.call( a, k ) || a[ k ] === undefined || a[ k ] === b[ k ] ) {
-                       // Support es3-shim: Without the hasOwn filter, comparing [] to {} will be false in ES3
-                       // because the shimmed "forEach" is enumerable and shows up in Array but not Object.
-                       // Also ignore undefined values, because there is no conceptual difference between
+                       // Ignore undefined values, because there is no conceptual difference between
                        // a key that is absent and a key that is present but whose value is undefined.
                        continue;
                }
                        // a key that is absent and a key that is present but whose value is undefined.
                        continue;
                }
@@ -685,17 +681,17 @@ oo.isPlainObject = $.isPlainObject;
 
        /**
         * @private
 
        /**
         * @private
-        * @param {OO.EventEmitter} ee
-        * @param {Function|string} method Function or method name
+        * @param {OO.EventEmitter} eventEmitter Event emitter
+        * @param {string} event Event name
         * @param {Object} binding
         */
         * @param {Object} binding
         */
-       function addBinding( ee, event, binding ) {
+       function addBinding( eventEmitter, event, binding ) {
                var bindings;
                // Auto-initialize bindings list
                var bindings;
                // Auto-initialize bindings list
-               if ( hasOwn.call( ee.bindings, event ) ) {
-                       bindings = ee.bindings[ event ];
+               if ( hasOwn.call( eventEmitter.bindings, event ) ) {
+                       bindings = eventEmitter.bindings[ event ];
                } else {
                } else {
-                       bindings = ee.bindings[ event ] = [];
+                       bindings = eventEmitter.bindings[ event ] = [];
                }
                // Add binding
                bindings.push( binding );
                }
                // Add binding
                bindings.push( binding );
@@ -713,8 +709,8 @@ oo.isPlainObject = $.isPlainObject;
         * @param {Function|string} method Function or method name to call when event occurs
         * @param {Array} [args] Arguments to pass to listener, will be prepended to emitted arguments
         * @param {Object} [context=null] Context object for function or method call
         * @param {Function|string} method Function or method name to call when event occurs
         * @param {Array} [args] Arguments to pass to listener, will be prepended to emitted arguments
         * @param {Object} [context=null] Context object for function or method call
-        * @throws {Error} Listener argument is not a function or a valid method name
         * @chainable
         * @chainable
+        * @throws {Error} Listener argument is not a function or a valid method name
         */
        oo.EventEmitter.prototype.on = function ( event, method, args, context ) {
                validateMethod( method, context );
         */
        oo.EventEmitter.prototype.on = function ( event, method, args, context ) {
                validateMethod( method, context );
@@ -1332,9 +1328,9 @@ oo.SortedEmitterList.prototype.setSortingCallback = function ( sortingCallback )
 /**
  * Add items to the sorted list.
  *
 /**
  * Add items to the sorted list.
  *
- * @chainable
  * @param {OO.EventEmitter|OO.EventEmitter[]} items Item to add or
  *  an array of items to add
  * @param {OO.EventEmitter|OO.EventEmitter[]} items Item to add or
  *  an array of items to add
+ * @chainable
  */
 oo.SortedEmitterList.prototype.addItems = function ( items ) {
        var index, i, insertionIndex;
  */
 oo.SortedEmitterList.prototype.addItems = function ( items ) {
        var index, i, insertionIndex;
@@ -1400,6 +1396,12 @@ oo.SortedEmitterList.prototype.findInsertionIndex = function ( item ) {
 /* global hasOwn */
 
 /**
 /* global hasOwn */
 
 /**
+ * A map interface for associating arbitrary data with a symbolic name. Used in
+ * place of a plain object to provide additional {@link #method-register registration}
+ * or {@link #method-lookup lookup} functionality.
+ *
+ * See <https://www.mediawiki.org/wiki/OOjs/Registries_and_factories>.
+ *
  * @class OO.Registry
  * @mixins OO.EventEmitter
  *
  * @class OO.Registry
  * @mixins OO.EventEmitter
  *