Comparing version 2.1.0 to 2.2.0
@@ -17,4 +17,5 @@ { | ||
"dot-notation": [ "error", { "allowKeywords": true } ], | ||
"no-implicit-globals": 0, | ||
"valid-jsdoc": 0 | ||
} | ||
} |
/*! | ||
* OOjs v2.1.0 optimised for jQuery | ||
* OOjs v2.2.0 optimised for jQuery | ||
* 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 | ||
* | ||
* Date: 2017-05-30T22:56:52Z | ||
* Date: 2018-04-03T19:45:13Z | ||
*/ | ||
@@ -15,3 +15,2 @@ ( function ( global ) { | ||
/* exported toString */ | ||
var | ||
@@ -26,2 +25,4 @@ /** | ||
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; | ||
@@ -92,8 +93,5 @@ | ||
// 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. | ||
// eslint-disable-next-line dot-notation | ||
targetFn[ 'super' ] = targetFn.parent = originFn; | ||
targetFn.super = targetFn.parent = originFn; | ||
@@ -269,3 +267,3 @@ targetFn.prototype = Object.create( originFn.prototype, { | ||
// 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 ] ]; | ||
@@ -401,5 +399,3 @@ } | ||
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. | ||
@@ -693,13 +689,13 @@ continue; | ||
* @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 | ||
*/ | ||
function addBinding( ee, event, binding ) { | ||
function addBinding( eventEmitter, event, binding ) { | ||
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 { | ||
bindings = ee.bindings[ event ] = []; | ||
bindings = eventEmitter.bindings[ event ] = []; | ||
} | ||
@@ -722,4 +718,4 @@ // Add binding | ||
* @param {Object} [context=null] Context object for function or method call | ||
* @chainable | ||
* @throws {Error} Listener argument is not a function or a valid method name | ||
* @chainable | ||
*/ | ||
@@ -1342,5 +1338,5 @@ oo.EventEmitter.prototype.on = function ( event, method, args, context ) { | ||
* | ||
* @chainable | ||
* @param {OO.EventEmitter|OO.EventEmitter[]} items Item to add or | ||
* an array of items to add | ||
* @chainable | ||
*/ | ||
@@ -1411,2 +1407,8 @@ oo.SortedEmitterList.prototype.addItems = function ( items ) { | ||
/** | ||
* 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 | ||
@@ -1413,0 +1415,0 @@ * @mixins OO.EventEmitter |
@@ -1,3 +0,3 @@ | ||
/*! OOjs v2.1.0 | https://oojs.mit-license.org */ | ||
!function(a){"use strict";function b(a,b,c){var d,e,f={},g=[];for(d=0,e=b.length;d<e;d++)f[b[d]]=!0;for(d=0,e=a.length;d<e;d++)!!f[a[d]]===c&&g.push(a[d]);return g}var c={},d=c.hasOwnProperty;c.toString;c.initClass=function(a){a.static=a.static||{}},c.inheritClass=function(a,b){var d;if(!b)throw new Error("inheritClass: Origin is not a function (actually "+b+")");if(a.prototype instanceof b)throw new Error("inheritClass: Target already inherits from origin");d=a.prototype.constructor,a.super=a.parent=b,a.prototype=Object.create(b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(b),a.static=Object.create(b.static)},c.mixinClass=function(a,b){var e;if(!b)throw new Error("mixinClass: Origin is not a function (actually "+b+")");for(e in b.prototype)"constructor"!==e&&d.call(b.prototype,e)&&(a.prototype[e]=b.prototype[e]);if(c.initClass(a),b.static)for(e in b.static)d.call(b.static,e)&&(a.static[e]=b.static[e]);else c.initClass(b)},c.isSubclass=function(a,b){return a===b||a.prototype instanceof b},c.getProp=function(a){var b,c=a;for(b=1;b<arguments.length;b++){if(void 0===c||null===c)return;c=c[arguments[b]]}return c},c.setProp=function(a){var b,c=a;if(!(Object(a)!==a||arguments.length<2)){for(b=1;b<arguments.length-2;b++){if(void 0===c[arguments[b]]&&(c[arguments[b]]={}),Object(c[arguments[b]])!==c[arguments[b]])return;c=c[arguments[b]]}c[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(a){var b,d=a,e=[d];if(!(Object(a)!==a||arguments.length<2)){for(b=1;b<arguments.length-1;b++){if(void 0===d[arguments[b]]||Object(d[arguments[b]])!==d[arguments[b]])return;d=d[arguments[b]],e.push(d)}for(delete d[arguments[b]];(d=e.pop())&&c.isPlainObject(d)&&!Object.keys(d).length;)delete e[e.length-1][arguments[e.length]]}},c.cloneObject=function(a){var b,c;c=Object.create(a.constructor.prototype);for(b in a)d.call(a,b)&&(c[b]=a[b]);return c},c.getObjectValues=function(a){var b,c;if(a!==Object(a))throw new TypeError("Called on non-object");c=[];for(b in a)d.call(a,b)&&(c[c.length]=a[b]);return c},c.binarySearch=function(a,b,c){for(var d,e,f=0,g=a.length;f<g;)if(d=f+g>>1,(e=b(a[d]))<0)g=d;else{if(!(e>0))return d;f=d+1}return c?g:null},c.compare=function(a,b,e){var f,g,h,i,j;if(a===b)return!0;if(a=a||{},b=b||{},"number"==typeof a.nodeType&&"function"==typeof a.isEqualNode)return a.isEqualNode(b);for(j in a)if(d.call(a,j)&&void 0!==a[j]&&a[j]!==b[j]&&(f=a[j],g=b[j],h=typeof f,i=typeof g,h!==i||("string"===h||"number"===h||"boolean"===h)&&f!==g||f===Object(f)&&!c.compare(f,g,!0)))return!1;return!!e||c.compare(b,a,!0)},c.copy=function(a,b,d){var e,f;if(d&&void 0!==(f=d(a)))return f;if(Array.isArray(a))f=new Array(a.length);else{if(a&&"function"==typeof a.clone)return b?b(a.clone()):a.clone();if(a&&"function"==typeof a.cloneNode)return b?b(a.cloneNode(!0)):a.cloneNode(!0);if(!c.isPlainObject(a))return b?b(a):a;f={}}for(e in a)f[e]=c.copy(a[e],b,d);return f},c.getHash=function(a){return JSON.stringify(a,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(a,b){var c,d,e,f;if(b&&"function"==typeof b.getHashObject&&(b=b.getHashObject()),Array.isArray(b)||Object(b)!==b)return b;for(c={},d=Object.keys(b).sort(),e=0,f=d.length;e<f;e+=1)c[d[e]]=b[d[e]];return c},c.unique=function(a){return a.reduce(function(a,b){return-1===a.indexOf(b)&&a.push(b),a},[])},c.simpleArrayUnion=function(){var a,b,c,d,e,f={},g=[];for(a=0,b=arguments.length;a<b;a++)for(c=arguments[a],d=0,e=c.length;d<e;d++)f[c[d]]||(f[c[d]]=!0,g.push(c[d]));return g},c.simpleArrayIntersection=function(a,c){return b(a,c,!0)},c.simpleArrayDifference=function(a,c){return b(a,c,!1)},c.isPlainObject=$.isPlainObject,function(){function a(a,b){if("string"==typeof a){if(void 0===b||null===b)throw new Error('Method name "'+a+'" has no context.');if("function"!=typeof b[a])throw new Error('Property "'+a+'" is not a function')}else if("function"!=typeof a)throw new Error("Invalid callback. Function or method name expected.")}function b(a,b,c){var e;e=d.call(a.bindings,b)?a.bindings[b]:a.bindings[b]=[],e.push(c)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(c,d,e,f){return a(d,f),b(this,c,{method:d,args:e,context:arguments.length<4?null:f,once:!1}),this},c.EventEmitter.prototype.once=function(c,d){return a(d),b(this,c,{method:d,args:void 0,context:null,once:!0}),this},c.EventEmitter.prototype.off=function(b,c,e){var f,g;if(1===arguments.length)return delete this.bindings[b],this;if(a(c,e),!d.call(this.bindings,b)||!this.bindings[b].length)return this;for(arguments.length<3&&(e=null),g=this.bindings[b],f=g.length;f--;)g[f].method===c&&g[f].context===e&&g.splice(f,1);return 0===g.length&&delete this.bindings[b],this},c.EventEmitter.prototype.emit=function(a){var b,c,e,f,g,h=[];if(d.call(this.bindings,a)){for(f=this.bindings[a].slice(),b=1,c=arguments.length;b<c;b++)h.push(arguments[b]);for(b=0,c=f.length;b<c;b++)e=f[b],g="string"==typeof e.method?e.context[e.method]:e.method,e.once&&this.off(a,g),g.apply(e.context,e.args?e.args.concat(h):h);return!0}return!1},c.EventEmitter.prototype.connect=function(a,b){var c,d,e;for(e in b)c=b[e],Array.isArray(c)?(d=c.slice(1),c=c[0]):d=[],this.on(e,c,d,a);return this},c.EventEmitter.prototype.disconnect=function(a,b){var c,d,e,f;if(b)for(d in b)e=b[d],Array.isArray(e)&&(e=e[0]),this.off(d,e,a);else for(d in this.bindings)for(f=this.bindings[d],c=f.length;c--;)f[c]&&f[c].context===a&&this.off(d,f[c].method,a);return this}}(),function(){function a(a,b){return void 0===b||b<0||b>=a.length?a.length:b}c.EmitterList=function(){this.items=[],this.aggregateItemEvents={}},c.EmitterList.prototype.getItems=function(){return this.items.slice(0)},c.EmitterList.prototype.getItemIndex=function(a){return this.items.indexOf(a)},c.EmitterList.prototype.getItemCount=function(){return this.items.length},c.EmitterList.prototype.isEmpty=function(){return!this.items.length},c.EmitterList.prototype.aggregate=function(a){var b,c,d,e,f,g;for(f in a){if(g=a[f],Object.prototype.hasOwnProperty.call(this.aggregateItemEvents,f)){if(g)throw new Error("Duplicate item event aggregation for "+f);for(b=0;b<this.items.length;b++)c=this.items[b],c.connect&&c.disconnect&&(e={},e[f]=["emit",this.aggregateItemEvents[f],c],c.disconnect(this,e));delete this.aggregateItemEvents[f]}if(g)for(this.aggregateItemEvents[f]=g,b=0;b<this.items.length;b++)c=this.items[b],c.connect&&c.disconnect&&(d={},d[f]=["emit",g,c],c.connect(this,d))}},c.EmitterList.prototype.addItems=function(b,c){var d,e;if(Array.isArray(b)||(b=[b]),0===b.length)return this;for(c=a(this.items,c),d=0;d<b.length;d++)e=this.items.indexOf(b[d]),-1!==e?(c=this.moveItem(b[d],c),this.emit("move",b[d],c,e)):(c=this.insertItem(b[d],c),this.emit("add",b[d],c)),c++;return this},c.EmitterList.prototype.moveItem=function(b,c){var d=this.items.indexOf(b);if(-1===d)throw new Error("Item cannot be moved, because it is not in the list.");return c=a(this.items,c),this.items.splice(d,1),d<c&&c--,this.items.splice(c,0,b),c},c.EmitterList.prototype.insertItem=function(b,c){var d,e;if(b.connect&&b.disconnect){d={};for(e in this.aggregateItemEvents)d[e]=["emit",this.aggregateItemEvents[e],b];b.connect(this,d)}return c=a(this.items,c),this.items.splice(c,0,b),c},c.EmitterList.prototype.removeItems=function(a){var b,c,d;if(Array.isArray(a)||(a=[a]),0===a.length)return this;for(b=0;b<a.length;b++)c=a[b],-1!==(d=this.items.indexOf(c))&&(c.connect&&c.disconnect&&c.disconnect(this),this.items.splice(d,1),this.emit("remove",c,d));return this},c.EmitterList.prototype.clearItems=function(){var a,b,c=this.items.splice(0,this.items.length);for(a=0;a<c.length;a++)b=c[a],b.connect&&b.disconnect&&b.disconnect(this);return this.emit("clear"),this}}(),c.SortedEmitterList=function(a){c.EmitterList.call(this),this.sortingCallback=a,this.aggregate({sortChange:"itemSortChange"}),this.connect(this,{itemSortChange:"onItemSortChange"})},c.mixinClass(c.SortedEmitterList,c.EmitterList),c.SortedEmitterList.prototype.onItemSortChange=function(a){this.removeItems(a),this.addItems(a)},c.SortedEmitterList.prototype.setSortingCallback=function(a){var b=this.getItems();this.sortingCallback=a,this.clearItems(),this.addItems(b)},c.SortedEmitterList.prototype.addItems=function(a){var b,c,d;if(Array.isArray(a)||(a=[a]),0===a.length)return this;for(c=0;c<a.length;c++)d=this.findInsertionIndex(a[c]),d<=this.items.length&&this.items[d]&&0===this.sortingCallback(this.items[d],a[c])&&this.removeItems(this.items[d]),b=this.insertItem(a[c],d),this.emit("add",a[c],b);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(a){var b=this;return c.binarySearch(this.items,function(c){return b.sortingCallback(a,c)},!0)},c.Registry=function(){c.EventEmitter.call(this),this.registry={}},c.mixinClass(c.Registry,c.EventEmitter),c.Registry.prototype.register=function(a,b){var c,d;if("string"==typeof a)this.registry[a]=b,this.emit("register",a,b);else{if(!Array.isArray(a))throw new Error("Name must be a string or array, cannot be a "+typeof a);for(c=0,d=a.length;c<d;c++)this.register(a[c],b)}},c.Registry.prototype.unregister=function(a){var b,c,d;if("string"==typeof a)void 0!==(d=this.lookup(a))&&(delete this.registry[a],this.emit("unregister",a,d));else{if(!Array.isArray(a))throw new Error("Name must be a string or array, cannot be a "+typeof a);for(b=0,c=a.length;b<c;b++)this.unregister(a[b])}},c.Registry.prototype.lookup=function(a){if(d.call(this.registry,a))return this.registry[a]},c.Factory=function(){c.Factory.super.call(this)},c.inheritClass(c.Factory,c.Registry),c.Factory.prototype.register=function(a){var b;if("function"!=typeof a)throw new Error("constructor must be a function, cannot be a "+typeof a);if("string"!=typeof(b=a.static&&a.static.name)||""===b)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.register.call(this,b,a)},c.Factory.prototype.unregister=function(a){var b;if("function"!=typeof a)throw new Error("constructor must be a function, cannot be a "+typeof a);if("string"!=typeof(b=a.static&&a.static.name)||""===b)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.unregister.call(this,b)},c.Factory.prototype.create=function(a){var b,c,d=[],e=this.lookup(a);if(!e)throw new Error("No class registered by that name: "+a);for(c=1;c<arguments.length;c++)d.push(arguments[c]);return b=Object.create(e.prototype),e.apply(b,d),b},"undefined"!=typeof module&&module.exports?module.exports=c:a.OO=c}(this); | ||
/*! OOjs v2.2.0 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var e={},r=e.hasOwnProperty;e.toString;function i(t,e,r){var i,n,o={},s=[];for(i=0,n=e.length;i<n;i++)o[e[i]]=!0;for(i=0,n=t.length;i<n;i++)!!o[t[i]]===r&&s.push(t[i]);return s}e.initClass=function(t){t.static=t.static||{}},e.inheritClass=function(t,r){var i;if(!r)throw new Error("inheritClass: Origin is not a function (actually "+r+")");if(t.prototype instanceof r)throw new Error("inheritClass: Target already inherits from origin");i=t.prototype.constructor,t.super=t.parent=r,t.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e.initClass(r),t.static=Object.create(r.static)},e.mixinClass=function(t,i){var n;if(!i)throw new Error("mixinClass: Origin is not a function (actually "+i+")");for(n in i.prototype)"constructor"!==n&&r.call(i.prototype,n)&&(t.prototype[n]=i.prototype[n]);if(e.initClass(t),i.static)for(n in i.static)r.call(i.static,n)&&(t.static[n]=i.static[n]);else e.initClass(i)},e.isSubclass=function(t,e){return t===e||t.prototype instanceof e},e.getProp=function(t){var e,r=t;for(e=1;e<arguments.length;e++){if(null==r)return;r=r[arguments[e]]}return r},e.setProp=function(t){var e,r=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===r[arguments[e]]&&(r[arguments[e]]={}),Object(r[arguments[e]])!==r[arguments[e]])return;r=r[arguments[e]]}r[arguments[arguments.length-2]]=arguments[arguments.length-1]}},e.deleteProp=function(t){var r,i=t,n=[i];if(!(Object(t)!==t||arguments.length<2)){for(r=1;r<arguments.length-1;r++){if(void 0===i[arguments[r]]||Object(i[arguments[r]])!==i[arguments[r]])return;i=i[arguments[r]],n.push(i)}for(delete i[arguments[r]];n.length>1&&(i=n.pop())&&e.isPlainObject(i)&&!Object.keys(i).length;)delete n[n.length-1][arguments[n.length]]}},e.cloneObject=function(t){var e,i;for(e in i=Object.create(t.constructor.prototype),t)r.call(t,e)&&(i[e]=t[e]);return i},e.getObjectValues=function(t){var e,i;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in i=[],t)r.call(t,e)&&(i[i.length]=t[e]);return i},e.binarySearch=function(t,e,r){for(var i,n,o=0,s=t.length;o<s;)if((n=e(t[i=o+s>>1]))<0)s=i;else{if(!(n>0))return i;o=i+1}return r?s:null},e.compare=function(t,i,n){var o,s,c,a;if(t===i)return!0;if(i=i||{},"number"==typeof(t=t||{}).nodeType&&"function"==typeof t.isEqualNode)return t.isEqualNode(i);for(a in t)if(r.call(t,a)&&void 0!==t[a]&&t[a]!==i[a]&&((c=typeof(o=t[a]))!==typeof(s=i[a])||("string"===c||"number"===c||"boolean"===c)&&o!==s||o===Object(o)&&!e.compare(o,s,!0)))return!1;return!!n||e.compare(i,t,!0)},e.copy=function(t,r,i){var n,o;if(i&&void 0!==(o=i(t)))return o;if(Array.isArray(t))o=new Array(t.length);else{if(t&&"function"==typeof t.clone)return r?r(t.clone()):t.clone();if(t&&"function"==typeof t.cloneNode)return r?r(t.cloneNode(!0)):t.cloneNode(!0);if(!e.isPlainObject(t))return r?r(t):t;o={}}for(n in t)o[n]=e.copy(t[n],r,i);return o},e.getHash=function(t){return JSON.stringify(t,e.getHash.keySortReplacer)},e.getHash.keySortReplacer=function(t,e){var r,i,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(r={},n=0,o=(i=Object.keys(e).sort()).length;n<o;n+=1)r[i[n]]=e[i[n]];return r},e.unique=function(t){return t.reduce(function(t,e){return-1===t.indexOf(e)&&t.push(e),t},[])},e.simpleArrayUnion=function(){var t,e,r,i,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(i=0,n=(r=arguments[t]).length;i<n;i++)o[r[i]]||(o[r[i]]=!0,s.push(r[i]));return s},e.simpleArrayIntersection=function(t,e){return i(t,e,!0)},e.simpleArrayDifference=function(t,e){return i(t,e,!1)},e.isPlainObject=$.isPlainObject,function(){function t(t,e){if("string"==typeof t){if(null==e)throw new Error('Method name "'+t+'" has no context.');if("function"!=typeof e[t])throw new Error('Property "'+t+'" is not a function')}else if("function"!=typeof t)throw new Error("Invalid callback. Function or method name expected.")}function i(t,e,i){(r.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(i)}e.EventEmitter=function(){this.bindings={}},e.initClass(e.EventEmitter),e.EventEmitter.prototype.on=function(e,r,n,o){return t(r,o),i(this,e,{method:r,args:n,context:arguments.length<4?null:o,once:!1}),this},e.EventEmitter.prototype.once=function(e,r){return t(r),i(this,e,{method:r,args:void 0,context:null,once:!0}),this},e.EventEmitter.prototype.off=function(e,i,n){var o,s;if(1===arguments.length)return delete this.bindings[e],this;if(t(i,n),!r.call(this.bindings,e)||!this.bindings[e].length)return this;for(arguments.length<3&&(n=null),o=(s=this.bindings[e]).length;o--;)s[o].method===i&&s[o].context===n&&s.splice(o,1);return 0===s.length&&delete this.bindings[e],this},e.EventEmitter.prototype.emit=function(t){var e,i,n,o,s,c=[];if(r.call(this.bindings,t)){for(o=this.bindings[t].slice(),e=1,i=arguments.length;e<i;e++)c.push(arguments[e]);for(e=0,i=o.length;e<i;e++)s="string"==typeof(n=o[e]).method?n.context[n.method]:n.method,n.once&&this.off(t,s),s.apply(n.context,n.args?n.args.concat(c):c);return!0}return!1},e.EventEmitter.prototype.connect=function(t,e){var r,i,n;for(n in e)r=e[n],Array.isArray(r)?(i=r.slice(1),r=r[0]):i=[],this.on(n,r,i,t);return this},e.EventEmitter.prototype.disconnect=function(t,e){var r,i,n,o;if(e)for(i in e)n=e[i],Array.isArray(n)&&(n=n[0]),this.off(i,n,t);else for(i in this.bindings)for(r=(o=this.bindings[i]).length;r--;)o[r]&&o[r].context===t&&this.off(i,o[r].method,t);return this}}(),function(){function t(t,e){return void 0===e||e<0||e>=t.length?t.length:e}e.EmitterList=function(){this.items=[],this.aggregateItemEvents={}},e.EmitterList.prototype.getItems=function(){return this.items.slice(0)},e.EmitterList.prototype.getItemIndex=function(t){return this.items.indexOf(t)},e.EmitterList.prototype.getItemCount=function(){return this.items.length},e.EmitterList.prototype.isEmpty=function(){return!this.items.length},e.EmitterList.prototype.aggregate=function(t){var e,r,i,n,o,s;for(o in t){if(s=t[o],Object.prototype.hasOwnProperty.call(this.aggregateItemEvents,o)){if(s)throw new Error("Duplicate item event aggregation for "+o);for(e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],r],r.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((i={})[o]=["emit",s,r],r.connect(this,i))}},e.EmitterList.prototype.addItems=function(e,r){var i,n;if(Array.isArray(e)||(e=[e]),0===e.length)return this;for(r=t(this.items,r),i=0;i<e.length;i++)-1!==(n=this.items.indexOf(e[i]))?(r=this.moveItem(e[i],r),this.emit("move",e[i],r,n)):(r=this.insertItem(e[i],r),this.emit("add",e[i],r)),r++;return this},e.EmitterList.prototype.moveItem=function(e,r){var i=this.items.indexOf(e);if(-1===i)throw new Error("Item cannot be moved, because it is not in the list.");return r=t(this.items,r),this.items.splice(i,1),i<r&&r--,this.items.splice(r,0,e),r},e.EmitterList.prototype.insertItem=function(e,r){var i,n;if(e.connect&&e.disconnect){for(n in i={},this.aggregateItemEvents)i[n]=["emit",this.aggregateItemEvents[n],e];e.connect(this,i)}return r=t(this.items,r),this.items.splice(r,0,e),r},e.EmitterList.prototype.removeItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)r=t[e],-1!==(i=this.items.indexOf(r))&&(r.connect&&r.disconnect&&r.disconnect(this),this.items.splice(i,1),this.emit("remove",r,i));return this},e.EmitterList.prototype.clearItems=function(){var t,e,r=this.items.splice(0,this.items.length);for(t=0;t<r.length;t++)(e=r[t]).connect&&e.disconnect&&e.disconnect(this);return this.emit("clear"),this}}(),e.SortedEmitterList=function(t){e.EmitterList.call(this),this.sortingCallback=t,this.aggregate({sortChange:"itemSortChange"}),this.connect(this,{itemSortChange:"onItemSortChange"})},e.mixinClass(e.SortedEmitterList,e.EmitterList),e.SortedEmitterList.prototype.onItemSortChange=function(t){this.removeItems(t),this.addItems(t)},e.SortedEmitterList.prototype.setSortingCallback=function(t){var e=this.getItems();this.sortingCallback=t,this.clearItems(),this.addItems(e)},e.SortedEmitterList.prototype.addItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(r=0;r<t.length;r++)(i=this.findInsertionIndex(t[r]))<=this.items.length&&this.items[i]&&0===this.sortingCallback(this.items[i],t[r])&&this.removeItems(this.items[i]),e=this.insertItem(t[r],i),this.emit("add",t[r],e);return this},e.SortedEmitterList.prototype.findInsertionIndex=function(t){var r=this;return e.binarySearch(this.items,function(e){return r.sortingCallback(t,e)},!0)},e.Registry=function(){e.EventEmitter.call(this),this.registry={}},e.mixinClass(e.Registry,e.EventEmitter),e.Registry.prototype.register=function(t,e){var r,i;if("string"==typeof t)this.registry[t]=e,this.emit("register",t,e);else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(r=0,i=t.length;r<i;r++)this.register(t[r],e)}},e.Registry.prototype.unregister=function(t){var e,r,i;if("string"==typeof t)void 0!==(i=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,i));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,r=t.length;e<r;e++)this.unregister(t[e])}},e.Registry.prototype.lookup=function(t){if(r.call(this.registry,t))return this.registry[t]},e.Factory=function(){e.Factory.super.call(this)},e.inheritClass(e.Factory,e.Registry),e.Factory.prototype.register=function(t){var r;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(r=t.static&&t.static.name)||""===r)throw new Error("Name must be a string and must not be empty");e.Factory.super.prototype.register.call(this,r,t)},e.Factory.prototype.unregister=function(t){var r;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(r=t.static&&t.static.name)||""===r)throw new Error("Name must be a string and must not be empty");e.Factory.super.prototype.unregister.call(this,r)},e.Factory.prototype.create=function(t){var e,r,i=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(r=1;r<arguments.length;r++)i.push(arguments[r]);return e=Object.create(n.prototype),n.apply(e,i),e},"undefined"!=typeof module&&module.exports?module.exports=e:t.OO=e}(this); | ||
//# sourceMappingURL=oojs.jquery.min.js.map |
/*! | ||
* OOjs v2.1.0 | ||
* OOjs v2.2.0 | ||
* 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 | ||
* | ||
* Date: 2017-05-30T22:56:52Z | ||
* Date: 2018-04-03T19:45:13Z | ||
*/ | ||
@@ -15,3 +15,2 @@ ( function ( global ) { | ||
/* exported toString */ | ||
var | ||
@@ -26,2 +25,4 @@ /** | ||
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; | ||
@@ -92,8 +93,5 @@ | ||
// 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. | ||
// eslint-disable-next-line dot-notation | ||
targetFn[ 'super' ] = targetFn.parent = originFn; | ||
targetFn.super = targetFn.parent = originFn; | ||
@@ -269,3 +267,3 @@ targetFn.prototype = Object.create( originFn.prototype, { | ||
// 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 ] ]; | ||
@@ -401,5 +399,3 @@ } | ||
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. | ||
@@ -717,13 +713,13 @@ continue; | ||
* @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 | ||
*/ | ||
function addBinding( ee, event, binding ) { | ||
function addBinding( eventEmitter, event, binding ) { | ||
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 { | ||
bindings = ee.bindings[ event ] = []; | ||
bindings = eventEmitter.bindings[ event ] = []; | ||
} | ||
@@ -746,4 +742,4 @@ // Add binding | ||
* @param {Object} [context=null] Context object for function or method call | ||
* @chainable | ||
* @throws {Error} Listener argument is not a function or a valid method name | ||
* @chainable | ||
*/ | ||
@@ -1366,5 +1362,5 @@ oo.EventEmitter.prototype.on = function ( event, method, args, context ) { | ||
* | ||
* @chainable | ||
* @param {OO.EventEmitter|OO.EventEmitter[]} items Item to add or | ||
* an array of items to add | ||
* @chainable | ||
*/ | ||
@@ -1435,2 +1431,8 @@ oo.SortedEmitterList.prototype.addItems = function ( items ) { | ||
/** | ||
* 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 | ||
@@ -1437,0 +1439,0 @@ * @mixins OO.EventEmitter |
@@ -1,3 +0,3 @@ | ||
/*! OOjs v2.1.0 | https://oojs.mit-license.org */ | ||
!function(a){"use strict";function b(a,b,c){var d,e,f={},g=[];for(d=0,e=b.length;d<e;d++)f[b[d]]=!0;for(d=0,e=a.length;d<e;d++)!!f[a[d]]===c&&g.push(a[d]);return g}var c={},d=c.hasOwnProperty,e=c.toString;c.initClass=function(a){a.static=a.static||{}},c.inheritClass=function(a,b){var d;if(!b)throw new Error("inheritClass: Origin is not a function (actually "+b+")");if(a.prototype instanceof b)throw new Error("inheritClass: Target already inherits from origin");d=a.prototype.constructor,a.super=a.parent=b,a.prototype=Object.create(b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(b),a.static=Object.create(b.static)},c.mixinClass=function(a,b){var e;if(!b)throw new Error("mixinClass: Origin is not a function (actually "+b+")");for(e in b.prototype)"constructor"!==e&&d.call(b.prototype,e)&&(a.prototype[e]=b.prototype[e]);if(c.initClass(a),b.static)for(e in b.static)d.call(b.static,e)&&(a.static[e]=b.static[e]);else c.initClass(b)},c.isSubclass=function(a,b){return a===b||a.prototype instanceof b},c.getProp=function(a){var b,c=a;for(b=1;b<arguments.length;b++){if(void 0===c||null===c)return;c=c[arguments[b]]}return c},c.setProp=function(a){var b,c=a;if(!(Object(a)!==a||arguments.length<2)){for(b=1;b<arguments.length-2;b++){if(void 0===c[arguments[b]]&&(c[arguments[b]]={}),Object(c[arguments[b]])!==c[arguments[b]])return;c=c[arguments[b]]}c[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(a){var b,d=a,e=[d];if(!(Object(a)!==a||arguments.length<2)){for(b=1;b<arguments.length-1;b++){if(void 0===d[arguments[b]]||Object(d[arguments[b]])!==d[arguments[b]])return;d=d[arguments[b]],e.push(d)}for(delete d[arguments[b]];(d=e.pop())&&c.isPlainObject(d)&&!Object.keys(d).length;)delete e[e.length-1][arguments[e.length]]}},c.cloneObject=function(a){var b,c;c=Object.create(a.constructor.prototype);for(b in a)d.call(a,b)&&(c[b]=a[b]);return c},c.getObjectValues=function(a){var b,c;if(a!==Object(a))throw new TypeError("Called on non-object");c=[];for(b in a)d.call(a,b)&&(c[c.length]=a[b]);return c},c.binarySearch=function(a,b,c){for(var d,e,f=0,g=a.length;f<g;)if(d=f+g>>1,(e=b(a[d]))<0)g=d;else{if(!(e>0))return d;f=d+1}return c?g:null},c.compare=function(a,b,e){var f,g,h,i,j;if(a===b)return!0;if(a=a||{},b=b||{},"number"==typeof a.nodeType&&"function"==typeof a.isEqualNode)return a.isEqualNode(b);for(j in a)if(d.call(a,j)&&void 0!==a[j]&&a[j]!==b[j]&&(f=a[j],g=b[j],h=typeof f,i=typeof g,h!==i||("string"===h||"number"===h||"boolean"===h)&&f!==g||f===Object(f)&&!c.compare(f,g,!0)))return!1;return!!e||c.compare(b,a,!0)},c.copy=function(a,b,d){var e,f;if(d&&void 0!==(f=d(a)))return f;if(Array.isArray(a))f=new Array(a.length);else{if(a&&"function"==typeof a.clone)return b?b(a.clone()):a.clone();if(a&&"function"==typeof a.cloneNode)return b?b(a.cloneNode(!0)):a.cloneNode(!0);if(!c.isPlainObject(a))return b?b(a):a;f={}}for(e in a)f[e]=c.copy(a[e],b,d);return f},c.getHash=function(a){return JSON.stringify(a,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(a,b){var c,d,e,f;if(b&&"function"==typeof b.getHashObject&&(b=b.getHashObject()),Array.isArray(b)||Object(b)!==b)return b;for(c={},d=Object.keys(b).sort(),e=0,f=d.length;e<f;e+=1)c[d[e]]=b[d[e]];return c},c.unique=function(a){return a.reduce(function(a,b){return-1===a.indexOf(b)&&a.push(b),a},[])},c.simpleArrayUnion=function(){var a,b,c,d,e,f={},g=[];for(a=0,b=arguments.length;a<b;a++)for(c=arguments[a],d=0,e=c.length;d<e;d++)f[c[d]]||(f[c[d]]=!0,g.push(c[d]));return g},c.simpleArrayIntersection=function(a,c){return b(a,c,!0)},c.simpleArrayDifference=function(a,c){return b(a,c,!1)},c.isPlainObject=function(a){var b;return!(!a||"[object Object]"!==e.call(a))&&(!(b=Object.getPrototypeOf(a))||d.call(b,"isPrototypeOf"))},function(){function a(a,b){if("string"==typeof a){if(void 0===b||null===b)throw new Error('Method name "'+a+'" has no context.');if("function"!=typeof b[a])throw new Error('Property "'+a+'" is not a function')}else if("function"!=typeof a)throw new Error("Invalid callback. Function or method name expected.")}function b(a,b,c){var e;e=d.call(a.bindings,b)?a.bindings[b]:a.bindings[b]=[],e.push(c)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(c,d,e,f){return a(d,f),b(this,c,{method:d,args:e,context:arguments.length<4?null:f,once:!1}),this},c.EventEmitter.prototype.once=function(c,d){return a(d),b(this,c,{method:d,args:void 0,context:null,once:!0}),this},c.EventEmitter.prototype.off=function(b,c,e){var f,g;if(1===arguments.length)return delete this.bindings[b],this;if(a(c,e),!d.call(this.bindings,b)||!this.bindings[b].length)return this;for(arguments.length<3&&(e=null),g=this.bindings[b],f=g.length;f--;)g[f].method===c&&g[f].context===e&&g.splice(f,1);return 0===g.length&&delete this.bindings[b],this},c.EventEmitter.prototype.emit=function(a){var b,c,e,f,g,h=[];if(d.call(this.bindings,a)){for(f=this.bindings[a].slice(),b=1,c=arguments.length;b<c;b++)h.push(arguments[b]);for(b=0,c=f.length;b<c;b++)e=f[b],g="string"==typeof e.method?e.context[e.method]:e.method,e.once&&this.off(a,g),g.apply(e.context,e.args?e.args.concat(h):h);return!0}return!1},c.EventEmitter.prototype.connect=function(a,b){var c,d,e;for(e in b)c=b[e],Array.isArray(c)?(d=c.slice(1),c=c[0]):d=[],this.on(e,c,d,a);return this},c.EventEmitter.prototype.disconnect=function(a,b){var c,d,e,f;if(b)for(d in b)e=b[d],Array.isArray(e)&&(e=e[0]),this.off(d,e,a);else for(d in this.bindings)for(f=this.bindings[d],c=f.length;c--;)f[c]&&f[c].context===a&&this.off(d,f[c].method,a);return this}}(),function(){function a(a,b){return void 0===b||b<0||b>=a.length?a.length:b}c.EmitterList=function(){this.items=[],this.aggregateItemEvents={}},c.EmitterList.prototype.getItems=function(){return this.items.slice(0)},c.EmitterList.prototype.getItemIndex=function(a){return this.items.indexOf(a)},c.EmitterList.prototype.getItemCount=function(){return this.items.length},c.EmitterList.prototype.isEmpty=function(){return!this.items.length},c.EmitterList.prototype.aggregate=function(a){var b,c,d,e,f,g;for(f in a){if(g=a[f],Object.prototype.hasOwnProperty.call(this.aggregateItemEvents,f)){if(g)throw new Error("Duplicate item event aggregation for "+f);for(b=0;b<this.items.length;b++)c=this.items[b],c.connect&&c.disconnect&&(e={},e[f]=["emit",this.aggregateItemEvents[f],c],c.disconnect(this,e));delete this.aggregateItemEvents[f]}if(g)for(this.aggregateItemEvents[f]=g,b=0;b<this.items.length;b++)c=this.items[b],c.connect&&c.disconnect&&(d={},d[f]=["emit",g,c],c.connect(this,d))}},c.EmitterList.prototype.addItems=function(b,c){var d,e;if(Array.isArray(b)||(b=[b]),0===b.length)return this;for(c=a(this.items,c),d=0;d<b.length;d++)e=this.items.indexOf(b[d]),-1!==e?(c=this.moveItem(b[d],c),this.emit("move",b[d],c,e)):(c=this.insertItem(b[d],c),this.emit("add",b[d],c)),c++;return this},c.EmitterList.prototype.moveItem=function(b,c){var d=this.items.indexOf(b);if(-1===d)throw new Error("Item cannot be moved, because it is not in the list.");return c=a(this.items,c),this.items.splice(d,1),d<c&&c--,this.items.splice(c,0,b),c},c.EmitterList.prototype.insertItem=function(b,c){var d,e;if(b.connect&&b.disconnect){d={};for(e in this.aggregateItemEvents)d[e]=["emit",this.aggregateItemEvents[e],b];b.connect(this,d)}return c=a(this.items,c),this.items.splice(c,0,b),c},c.EmitterList.prototype.removeItems=function(a){var b,c,d;if(Array.isArray(a)||(a=[a]),0===a.length)return this;for(b=0;b<a.length;b++)c=a[b],-1!==(d=this.items.indexOf(c))&&(c.connect&&c.disconnect&&c.disconnect(this),this.items.splice(d,1),this.emit("remove",c,d));return this},c.EmitterList.prototype.clearItems=function(){var a,b,c=this.items.splice(0,this.items.length);for(a=0;a<c.length;a++)b=c[a],b.connect&&b.disconnect&&b.disconnect(this);return this.emit("clear"),this}}(),c.SortedEmitterList=function(a){c.EmitterList.call(this),this.sortingCallback=a,this.aggregate({sortChange:"itemSortChange"}),this.connect(this,{itemSortChange:"onItemSortChange"})},c.mixinClass(c.SortedEmitterList,c.EmitterList),c.SortedEmitterList.prototype.onItemSortChange=function(a){this.removeItems(a),this.addItems(a)},c.SortedEmitterList.prototype.setSortingCallback=function(a){var b=this.getItems();this.sortingCallback=a,this.clearItems(),this.addItems(b)},c.SortedEmitterList.prototype.addItems=function(a){var b,c,d;if(Array.isArray(a)||(a=[a]),0===a.length)return this;for(c=0;c<a.length;c++)d=this.findInsertionIndex(a[c]),d<=this.items.length&&this.items[d]&&0===this.sortingCallback(this.items[d],a[c])&&this.removeItems(this.items[d]),b=this.insertItem(a[c],d),this.emit("add",a[c],b);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(a){var b=this;return c.binarySearch(this.items,function(c){return b.sortingCallback(a,c)},!0)},c.Registry=function(){c.EventEmitter.call(this),this.registry={}},c.mixinClass(c.Registry,c.EventEmitter),c.Registry.prototype.register=function(a,b){var c,d;if("string"==typeof a)this.registry[a]=b,this.emit("register",a,b);else{if(!Array.isArray(a))throw new Error("Name must be a string or array, cannot be a "+typeof a);for(c=0,d=a.length;c<d;c++)this.register(a[c],b)}},c.Registry.prototype.unregister=function(a){var b,c,d;if("string"==typeof a)void 0!==(d=this.lookup(a))&&(delete this.registry[a],this.emit("unregister",a,d));else{if(!Array.isArray(a))throw new Error("Name must be a string or array, cannot be a "+typeof a);for(b=0,c=a.length;b<c;b++)this.unregister(a[b])}},c.Registry.prototype.lookup=function(a){if(d.call(this.registry,a))return this.registry[a]},c.Factory=function(){c.Factory.super.call(this)},c.inheritClass(c.Factory,c.Registry),c.Factory.prototype.register=function(a){var b;if("function"!=typeof a)throw new Error("constructor must be a function, cannot be a "+typeof a);if("string"!=typeof(b=a.static&&a.static.name)||""===b)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.register.call(this,b,a)},c.Factory.prototype.unregister=function(a){var b;if("function"!=typeof a)throw new Error("constructor must be a function, cannot be a "+typeof a);if("string"!=typeof(b=a.static&&a.static.name)||""===b)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.unregister.call(this,b)},c.Factory.prototype.create=function(a){var b,c,d=[],e=this.lookup(a);if(!e)throw new Error("No class registered by that name: "+a);for(c=1;c<arguments.length;c++)d.push(arguments[c]);return b=Object.create(e.prototype),e.apply(b,d),b},"undefined"!=typeof module&&module.exports?module.exports=c:a.OO=c}(this); | ||
/*! OOjs v2.2.0 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var e={},r=e.hasOwnProperty,i=e.toString;function n(t,e,r){var i,n,o={},s=[];for(i=0,n=e.length;i<n;i++)o[e[i]]=!0;for(i=0,n=t.length;i<n;i++)!!o[t[i]]===r&&s.push(t[i]);return s}e.initClass=function(t){t.static=t.static||{}},e.inheritClass=function(t,r){var i;if(!r)throw new Error("inheritClass: Origin is not a function (actually "+r+")");if(t.prototype instanceof r)throw new Error("inheritClass: Target already inherits from origin");i=t.prototype.constructor,t.super=t.parent=r,t.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e.initClass(r),t.static=Object.create(r.static)},e.mixinClass=function(t,i){var n;if(!i)throw new Error("mixinClass: Origin is not a function (actually "+i+")");for(n in i.prototype)"constructor"!==n&&r.call(i.prototype,n)&&(t.prototype[n]=i.prototype[n]);if(e.initClass(t),i.static)for(n in i.static)r.call(i.static,n)&&(t.static[n]=i.static[n]);else e.initClass(i)},e.isSubclass=function(t,e){return t===e||t.prototype instanceof e},e.getProp=function(t){var e,r=t;for(e=1;e<arguments.length;e++){if(null==r)return;r=r[arguments[e]]}return r},e.setProp=function(t){var e,r=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===r[arguments[e]]&&(r[arguments[e]]={}),Object(r[arguments[e]])!==r[arguments[e]])return;r=r[arguments[e]]}r[arguments[arguments.length-2]]=arguments[arguments.length-1]}},e.deleteProp=function(t){var r,i=t,n=[i];if(!(Object(t)!==t||arguments.length<2)){for(r=1;r<arguments.length-1;r++){if(void 0===i[arguments[r]]||Object(i[arguments[r]])!==i[arguments[r]])return;i=i[arguments[r]],n.push(i)}for(delete i[arguments[r]];n.length>1&&(i=n.pop())&&e.isPlainObject(i)&&!Object.keys(i).length;)delete n[n.length-1][arguments[n.length]]}},e.cloneObject=function(t){var e,i;for(e in i=Object.create(t.constructor.prototype),t)r.call(t,e)&&(i[e]=t[e]);return i},e.getObjectValues=function(t){var e,i;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in i=[],t)r.call(t,e)&&(i[i.length]=t[e]);return i},e.binarySearch=function(t,e,r){for(var i,n,o=0,s=t.length;o<s;)if((n=e(t[i=o+s>>1]))<0)s=i;else{if(!(n>0))return i;o=i+1}return r?s:null},e.compare=function(t,i,n){var o,s,c,a;if(t===i)return!0;if(i=i||{},"number"==typeof(t=t||{}).nodeType&&"function"==typeof t.isEqualNode)return t.isEqualNode(i);for(a in t)if(r.call(t,a)&&void 0!==t[a]&&t[a]!==i[a]&&((c=typeof(o=t[a]))!==typeof(s=i[a])||("string"===c||"number"===c||"boolean"===c)&&o!==s||o===Object(o)&&!e.compare(o,s,!0)))return!1;return!!n||e.compare(i,t,!0)},e.copy=function(t,r,i){var n,o;if(i&&void 0!==(o=i(t)))return o;if(Array.isArray(t))o=new Array(t.length);else{if(t&&"function"==typeof t.clone)return r?r(t.clone()):t.clone();if(t&&"function"==typeof t.cloneNode)return r?r(t.cloneNode(!0)):t.cloneNode(!0);if(!e.isPlainObject(t))return r?r(t):t;o={}}for(n in t)o[n]=e.copy(t[n],r,i);return o},e.getHash=function(t){return JSON.stringify(t,e.getHash.keySortReplacer)},e.getHash.keySortReplacer=function(t,e){var r,i,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(r={},n=0,o=(i=Object.keys(e).sort()).length;n<o;n+=1)r[i[n]]=e[i[n]];return r},e.unique=function(t){return t.reduce(function(t,e){return-1===t.indexOf(e)&&t.push(e),t},[])},e.simpleArrayUnion=function(){var t,e,r,i,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(i=0,n=(r=arguments[t]).length;i<n;i++)o[r[i]]||(o[r[i]]=!0,s.push(r[i]));return s},e.simpleArrayIntersection=function(t,e){return n(t,e,!0)},e.simpleArrayDifference=function(t,e){return n(t,e,!1)},e.isPlainObject=function(t){var e;return!(!t||"[object Object]"!==i.call(t))&&(!(e=Object.getPrototypeOf(t))||r.call(e,"isPrototypeOf"))},function(){function t(t,e){if("string"==typeof t){if(null==e)throw new Error('Method name "'+t+'" has no context.');if("function"!=typeof e[t])throw new Error('Property "'+t+'" is not a function')}else if("function"!=typeof t)throw new Error("Invalid callback. Function or method name expected.")}function i(t,e,i){(r.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(i)}e.EventEmitter=function(){this.bindings={}},e.initClass(e.EventEmitter),e.EventEmitter.prototype.on=function(e,r,n,o){return t(r,o),i(this,e,{method:r,args:n,context:arguments.length<4?null:o,once:!1}),this},e.EventEmitter.prototype.once=function(e,r){return t(r),i(this,e,{method:r,args:void 0,context:null,once:!0}),this},e.EventEmitter.prototype.off=function(e,i,n){var o,s;if(1===arguments.length)return delete this.bindings[e],this;if(t(i,n),!r.call(this.bindings,e)||!this.bindings[e].length)return this;for(arguments.length<3&&(n=null),o=(s=this.bindings[e]).length;o--;)s[o].method===i&&s[o].context===n&&s.splice(o,1);return 0===s.length&&delete this.bindings[e],this},e.EventEmitter.prototype.emit=function(t){var e,i,n,o,s,c=[];if(r.call(this.bindings,t)){for(o=this.bindings[t].slice(),e=1,i=arguments.length;e<i;e++)c.push(arguments[e]);for(e=0,i=o.length;e<i;e++)s="string"==typeof(n=o[e]).method?n.context[n.method]:n.method,n.once&&this.off(t,s),s.apply(n.context,n.args?n.args.concat(c):c);return!0}return!1},e.EventEmitter.prototype.connect=function(t,e){var r,i,n;for(n in e)r=e[n],Array.isArray(r)?(i=r.slice(1),r=r[0]):i=[],this.on(n,r,i,t);return this},e.EventEmitter.prototype.disconnect=function(t,e){var r,i,n,o;if(e)for(i in e)n=e[i],Array.isArray(n)&&(n=n[0]),this.off(i,n,t);else for(i in this.bindings)for(r=(o=this.bindings[i]).length;r--;)o[r]&&o[r].context===t&&this.off(i,o[r].method,t);return this}}(),function(){function t(t,e){return void 0===e||e<0||e>=t.length?t.length:e}e.EmitterList=function(){this.items=[],this.aggregateItemEvents={}},e.EmitterList.prototype.getItems=function(){return this.items.slice(0)},e.EmitterList.prototype.getItemIndex=function(t){return this.items.indexOf(t)},e.EmitterList.prototype.getItemCount=function(){return this.items.length},e.EmitterList.prototype.isEmpty=function(){return!this.items.length},e.EmitterList.prototype.aggregate=function(t){var e,r,i,n,o,s;for(o in t){if(s=t[o],Object.prototype.hasOwnProperty.call(this.aggregateItemEvents,o)){if(s)throw new Error("Duplicate item event aggregation for "+o);for(e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],r],r.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((i={})[o]=["emit",s,r],r.connect(this,i))}},e.EmitterList.prototype.addItems=function(e,r){var i,n;if(Array.isArray(e)||(e=[e]),0===e.length)return this;for(r=t(this.items,r),i=0;i<e.length;i++)-1!==(n=this.items.indexOf(e[i]))?(r=this.moveItem(e[i],r),this.emit("move",e[i],r,n)):(r=this.insertItem(e[i],r),this.emit("add",e[i],r)),r++;return this},e.EmitterList.prototype.moveItem=function(e,r){var i=this.items.indexOf(e);if(-1===i)throw new Error("Item cannot be moved, because it is not in the list.");return r=t(this.items,r),this.items.splice(i,1),i<r&&r--,this.items.splice(r,0,e),r},e.EmitterList.prototype.insertItem=function(e,r){var i,n;if(e.connect&&e.disconnect){for(n in i={},this.aggregateItemEvents)i[n]=["emit",this.aggregateItemEvents[n],e];e.connect(this,i)}return r=t(this.items,r),this.items.splice(r,0,e),r},e.EmitterList.prototype.removeItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)r=t[e],-1!==(i=this.items.indexOf(r))&&(r.connect&&r.disconnect&&r.disconnect(this),this.items.splice(i,1),this.emit("remove",r,i));return this},e.EmitterList.prototype.clearItems=function(){var t,e,r=this.items.splice(0,this.items.length);for(t=0;t<r.length;t++)(e=r[t]).connect&&e.disconnect&&e.disconnect(this);return this.emit("clear"),this}}(),e.SortedEmitterList=function(t){e.EmitterList.call(this),this.sortingCallback=t,this.aggregate({sortChange:"itemSortChange"}),this.connect(this,{itemSortChange:"onItemSortChange"})},e.mixinClass(e.SortedEmitterList,e.EmitterList),e.SortedEmitterList.prototype.onItemSortChange=function(t){this.removeItems(t),this.addItems(t)},e.SortedEmitterList.prototype.setSortingCallback=function(t){var e=this.getItems();this.sortingCallback=t,this.clearItems(),this.addItems(e)},e.SortedEmitterList.prototype.addItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(r=0;r<t.length;r++)(i=this.findInsertionIndex(t[r]))<=this.items.length&&this.items[i]&&0===this.sortingCallback(this.items[i],t[r])&&this.removeItems(this.items[i]),e=this.insertItem(t[r],i),this.emit("add",t[r],e);return this},e.SortedEmitterList.prototype.findInsertionIndex=function(t){var r=this;return e.binarySearch(this.items,function(e){return r.sortingCallback(t,e)},!0)},e.Registry=function(){e.EventEmitter.call(this),this.registry={}},e.mixinClass(e.Registry,e.EventEmitter),e.Registry.prototype.register=function(t,e){var r,i;if("string"==typeof t)this.registry[t]=e,this.emit("register",t,e);else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(r=0,i=t.length;r<i;r++)this.register(t[r],e)}},e.Registry.prototype.unregister=function(t){var e,r,i;if("string"==typeof t)void 0!==(i=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,i));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,r=t.length;e<r;e++)this.unregister(t[e])}},e.Registry.prototype.lookup=function(t){if(r.call(this.registry,t))return this.registry[t]},e.Factory=function(){e.Factory.super.call(this)},e.inheritClass(e.Factory,e.Registry),e.Factory.prototype.register=function(t){var r;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(r=t.static&&t.static.name)||""===r)throw new Error("Name must be a string and must not be empty");e.Factory.super.prototype.register.call(this,r,t)},e.Factory.prototype.unregister=function(t){var r;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(r=t.static&&t.static.name)||""===r)throw new Error("Name must be a string and must not be empty");e.Factory.super.prototype.unregister.call(this,r)},e.Factory.prototype.create=function(t){var e,r,i=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(r=1;r<arguments.length;r++)i.push(arguments[r]);return e=Object.create(n.prototype),n.apply(e,i),e},"undefined"!=typeof module&&module.exports?module.exports=e:t.OO=e}(this); | ||
//# sourceMappingURL=oojs.min.js.map |
@@ -15,3 +15,7 @@ /*! | ||
module.exports = function ( grunt ) { | ||
var sauceBrowsers = require( './tests/saucelabs.browsers.js' ), | ||
var customLaunchers = require( './tests/karma.browsers.js' ), | ||
// Set --no-sandbox for Chrome on Travis. | ||
// https://docs.travis-ci.com/user/environment-variables/ | ||
// See karma.browser.js for details. | ||
chromeHeadless = process.env.TRAVIS ? 'ChromeHeadlessNoSandbox' : 'ChromeHeadless', | ||
concatFiles = [ | ||
@@ -89,10 +93,2 @@ 'src/intro.js.txt', | ||
eslint: { | ||
fix: { | ||
options: { | ||
fix: true | ||
}, | ||
src: [ | ||
'<%= eslint.dev %>' | ||
] | ||
}, | ||
dev: [ | ||
@@ -128,3 +124,3 @@ '*.js', | ||
autoWatch: false, | ||
customLaunchers: sauceBrowsers, | ||
customLaunchers: customLaunchers, | ||
sauceLabs: { | ||
@@ -141,7 +137,11 @@ username: process.env.SAUCE_USERNAME || 'oojs', | ||
// Latest versions of major browsers | ||
'slChrome', 'slFirefox', 'slEdge', | ||
'slChrome', | ||
'slFirefox', | ||
'slEdge', | ||
// Latest versions of complicated browsers | ||
'slSafari', 'slIE', | ||
'slSafari', | ||
'slIE', | ||
// Earliest-supported versions of complicated browsers | ||
'slSafari6', 'slIE9' | ||
'slSafari7', | ||
'slIE10' | ||
] | ||
@@ -151,3 +151,3 @@ }, | ||
main: { | ||
browsers: [ 'Chrome' ], | ||
browsers: [ chromeHeadless ], | ||
preprocessors: { | ||
@@ -170,3 +170,5 @@ 'dist/*.js': [ 'coverage' ] | ||
'text-summary': null, | ||
html: 'coverage/' | ||
html: 'coverage/', | ||
lcovonly: 'coverage/lcov.info', | ||
clover: 'coverage/clover.xml' | ||
} | ||
@@ -176,3 +178,3 @@ } | ||
jquery: { | ||
browsers: [ 'Chrome' ], | ||
browsers: [ chromeHeadless ], | ||
options: { | ||
@@ -187,3 +189,3 @@ files: [ | ||
}, | ||
other: { | ||
firefox: { | ||
browsers: [ 'Firefox' ] | ||
@@ -216,6 +218,8 @@ } | ||
grunt.registerTask( 'build', [ 'clean', 'concat:oojs', 'concat:jquery', 'copy:dist', 'uglify' ] ); | ||
grunt.registerTask( '_test', [ 'git-build', 'clean', 'concat:test', 'concat:jquery', 'eslint:dev', 'karma:main', 'karma:jquery', 'karma:other' ] ); | ||
grunt.registerTask( 'ci', [ '_test', 'karma:ci' ] ); | ||
grunt.registerTask( '_test', [ 'git-build', 'clean', 'concat:test', 'concat:jquery', 'eslint:dev', 'karma:main', 'karma:jquery' ] ); | ||
grunt.registerTask( 'ci', [ '_test', 'karma:firefox', 'karma:ci' ] ); | ||
if ( process.env.ZUUL_PIPELINE === 'gate-and-submit' ) { | ||
// During the merge pipeline, also include the cross-platform | ||
// tests via SauceLabs | ||
grunt.registerTask( 'test', 'ci' ); | ||
@@ -222,0 +226,0 @@ } else { |
# OOjs Release History | ||
## v2.2.0 / 2018-04-03 | ||
* [DEPRECATING CHANGE] Drop more code supporting ES3 / IE<=9 (Ed Sanders) | ||
* core: Fix deprecateProp() case where root object is empty (Ed Sanders) | ||
* doc: Add intro for OO.Registry (Prateek Saxena) | ||
* doc: Fix valid-jsdoc issues in EventEmitter and SortedEmitterList (Ed Sanders) | ||
* build: Add Travis CI and Codecov configuration (Timo Tijhof) | ||
* build: Bump most devDependencies to latest (James D. Forrester) | ||
* build: Disable eslint sourceType=module option (Timo Tijhof) | ||
* build: Generate clover.xml with code coverage results (Kunal Mehta) | ||
* build: Set --no-sandbox in Chrome for Travis (Timo Tijhof) | ||
* build: Test against Safari 7, Safari 6 is no longer around (James D. Forrester) | ||
* build: Update eslint to 0.4.0 (Ed Sanders) | ||
* build: Update eslint-config-wikimedia 0.4->0.5, eslint 19->20 (Ed Sanders) | ||
* build: Upgrade qunitjs to 2.4.1 (James D. Forrester) | ||
* build: Upgrade qunitjs to 2.6.0 (Timo Tijhof) | ||
## v2.1.0 / 2017-05-31 | ||
@@ -4,0 +20,0 @@ * EmitterList: Fix moving an item to a lower index (Andrew Green) |
{ | ||
"name": "oojs", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Power for object oriented JavaScript libraries.", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"scripts": { | ||
"test": "grunt test && node tests/node-index.js", | ||
"test": "grunt test && qunit tests/node-index.js", | ||
"doc": "jsduck", | ||
@@ -28,22 +28,21 @@ "prepublish": "grunt build" | ||
"devDependencies": { | ||
"eslint-config-wikimedia": "0.3.0", | ||
"grunt": "1.0.1", | ||
"grunt-contrib-clean": "1.0.0", | ||
"eslint-config-wikimedia": "0.5.0", | ||
"grunt": "1.0.2", | ||
"grunt-contrib-clean": "1.1.0", | ||
"grunt-contrib-concat": "1.0.1", | ||
"grunt-contrib-copy": "1.0.0", | ||
"grunt-contrib-uglify": "2.3.0", | ||
"grunt-contrib-uglify": "3.3.0", | ||
"grunt-contrib-watch": "1.0.0", | ||
"grunt-eslint": "19.0.0", | ||
"grunt-eslint": "20.1.0", | ||
"grunt-karma": "2.0.0", | ||
"jquery": "3.2.1", | ||
"karma": "1.5.0", | ||
"karma-chrome-launcher": "2.0.0", | ||
"karma": "2.0.0", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-coverage": "1.1.1", | ||
"karma-firefox-launcher": "1.0.1", | ||
"karma-qunit": "1.2.1", | ||
"karma-firefox-launcher": "1.1.0", | ||
"karma-qunit": "2.0.1", | ||
"karma-remap-istanbul": "0.6.0", | ||
"karma-sauce-launcher": "1.1.0", | ||
"qunit": "1.0.0", | ||
"qunitjs": "2.3.0" | ||
"karma-sauce-launcher": "1.2.0", | ||
"qunit": "2.6.0" | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
/* exported toString */ | ||
var | ||
@@ -11,2 +10,4 @@ /** | ||
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; | ||
@@ -77,8 +78,5 @@ | ||
// 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. | ||
// eslint-disable-next-line dot-notation | ||
targetFn[ 'super' ] = targetFn.parent = originFn; | ||
targetFn.super = targetFn.parent = originFn; | ||
@@ -254,3 +252,3 @@ targetFn.prototype = Object.create( originFn.prototype, { | ||
// 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 ] ]; | ||
@@ -386,5 +384,3 @@ } | ||
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. | ||
@@ -391,0 +387,0 @@ continue; |
@@ -56,13 +56,13 @@ /* global hasOwn */ | ||
* @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 | ||
*/ | ||
function addBinding( ee, event, binding ) { | ||
function addBinding( eventEmitter, event, binding ) { | ||
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 { | ||
bindings = ee.bindings[ event ] = []; | ||
bindings = eventEmitter.bindings[ event ] = []; | ||
} | ||
@@ -85,4 +85,4 @@ // Add binding | ||
* @param {Object} [context=null] Context object for function or method call | ||
* @chainable | ||
* @throws {Error} Listener argument is not a function or a valid method name | ||
* @chainable | ||
*/ | ||
@@ -89,0 +89,0 @@ oo.EventEmitter.prototype.on = function ( event, method, args, context ) { |
/* 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 | ||
@@ -5,0 +11,0 @@ * @mixins OO.EventEmitter |
@@ -86,5 +86,5 @@ /** | ||
* | ||
* @chainable | ||
* @param {OO.EventEmitter|OO.EventEmitter[]} items Item to add or | ||
* an array of items to add | ||
* @chainable | ||
*/ | ||
@@ -91,0 +91,0 @@ oo.SortedEmitterList.prototype.addItems = function ( items ) { |
/* eslint-env node */ | ||
var qunit = require( 'qunit' ); | ||
global.OO = require( '../dist/oojs.js' ); | ||
qunit.setup( { | ||
log: { | ||
summary: true, | ||
errors: true | ||
} | ||
} ); | ||
qunit.run( { | ||
code: { | ||
path: './dist/oojs.js', | ||
namespace: 'OO' | ||
}, | ||
tests: [ | ||
'./tests/unit/core.test.js', | ||
'./tests/unit/util.test.js', | ||
'./tests/unit/EventEmitter.test.js', | ||
'./tests/unit/EmitterList.test.js', | ||
'./tests/unit/SortedEmitterList.test.js', | ||
'./tests/unit/Registry.test.js', | ||
'./tests/unit/Factory.test.js' | ||
] | ||
}, function ( err, report ) { | ||
if ( err || report.failed ) { | ||
process.exit( 1 ); | ||
} | ||
} ); | ||
require( './unit/core.test.js' ); | ||
require( './unit/util.test.js' ); | ||
require( './unit/EventEmitter.test.js' ); | ||
require( './unit/EmitterList.test.js' ); | ||
require( './unit/SortedEmitterList.test.js' ); | ||
require( './unit/Registry.test.js' ); | ||
require( './unit/Factory.test.js' ); |
@@ -93,8 +93,2 @@ ( function ( oo, global ) { | ||
// In compliant ES3 and ES5 engines a property is enumerable by default, and to | ||
// make our restored constructor property unenumerable we'd need ES5. | ||
// In IE8 this happens to work because it has a bug where certain Object.prototype | ||
// keys that are unenumerable affect plain objects and thus it was never enumerable | ||
// to begin with. | ||
// https://developer.mozilla.org/en-US/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug | ||
assert.strictEqual( | ||
@@ -307,2 +301,3 @@ enumKeys.indexOf( 'constructor' ), | ||
assert.strictEqual( obj.bar.hasOwnProperty( 'quux' ), false, 'deleting an existing key with depth 3 cleans up empty object' ); | ||
// Reset | ||
oo.setProp( obj, 'bar', 'quux', 'whee', 'yay' ); | ||
@@ -316,2 +311,11 @@ | ||
assert.strictEqual( obj.hasOwnProperty( 'foo' ), true, 'descending into primitive (number) preserves fails silently' ); | ||
// Remove siblings | ||
oo.deleteProp( obj, 'foo' ); | ||
oo.deleteProp( obj, 'bar', 'baz' ); | ||
// Reset | ||
oo.setProp( obj, 'bar', 'quux', 'whee', 'yay' ); | ||
oo.deleteProp( obj.bar, 'quux', 'whee' ); | ||
assert.strictEqual( obj.hasOwnProperty( 'bar' ), true, 'empty object not deleted if not part of the arguments list' ); | ||
} ); | ||
@@ -445,15 +449,11 @@ }; | ||
if ( !Object.create ) { | ||
assert.strictEqual( true, true, '[skipped] Only own properties' ); | ||
} else { | ||
tmp = Object.create( { a: 1, b: false, foo: 'bar' } ); | ||
tmp.b = true; | ||
tmp.bar = 'quux'; | ||
tmp = Object.create( { a: 1, b: false, foo: 'bar' } ); | ||
tmp.b = true; | ||
tmp.bar = 'quux'; | ||
assert.deepEqual( | ||
oo.getObjectValues( tmp ), | ||
[ true, 'quux' ], | ||
'Only own properties' | ||
); | ||
} | ||
assert.deepEqual( | ||
oo.getObjectValues( tmp ), | ||
[ true, 'quux' ], | ||
'Only own properties' | ||
); | ||
@@ -670,22 +670,17 @@ assert.throws( | ||
if ( !Object.create ) { | ||
assert.strictEqual( true, true, '[skipped] Ignore inherited properties and methods of a' ); | ||
assert.strictEqual( true, true, '[skipped] Ignore inherited properties and methods of b' ); | ||
} else { | ||
x = Object.create( { foo: 1, map: function () { } } ); | ||
x.foo = 2; | ||
x.bar = true; | ||
x = Object.create( { foo: 1, map: function () { } } ); | ||
x.foo = 2; | ||
x.bar = true; | ||
assert.strictEqual( | ||
oo.compare( x, { foo: 2, bar: true } ), | ||
true, | ||
'Ignore inherited properties and methods of a' | ||
); | ||
assert.strictEqual( | ||
oo.compare( x, { foo: 2, bar: true } ), | ||
true, | ||
'Ignore inherited properties and methods of a' | ||
); | ||
assert.strictEqual( | ||
oo.compare( { foo: 2, bar: true }, x ), | ||
true, | ||
'Ignore inherited properties and methods of b' | ||
); | ||
} | ||
assert.strictEqual( | ||
oo.compare( { foo: 2, bar: true }, x ), | ||
true, | ||
'Ignore inherited properties and methods of b' | ||
); | ||
@@ -1050,3 +1045,4 @@ assert.strictEqual( | ||
function ( val ) { | ||
return val += ' leaf'; | ||
val += ' leaf'; | ||
return val; | ||
} | ||
@@ -1216,3 +1212,3 @@ ), | ||
* circular reference (https://github.com/ariya/phantomjs/issues/11206). | ||
* We know latest Chrome/Firefox and IE8+ support this. So, for the sake of | ||
* We know latest Chrome/Firefox and IE10+ support this. So, for the sake of | ||
* having qunit/phantomjs work, lets disable this for now. | ||
@@ -1219,0 +1215,0 @@ obj.f = obj; |
@@ -11,7 +11,5 @@ ( function ( oo ) { | ||
function ( a, b ) { | ||
return a.getContent() < b.getContent() ? -1 : | ||
( | ||
a.getContent() > b.getContent() ? 1 : | ||
0 | ||
); | ||
return a.getContent() < b.getContent() ? -1 : ( | ||
a.getContent() > b.getContent() ? 1 : 0 | ||
); | ||
} | ||
@@ -97,7 +95,5 @@ ); | ||
// Flip the sort | ||
return a.getContent() > b.getContent() ? -1 : | ||
( | ||
a.getContent() < b.getContent() ? 1 : | ||
0 | ||
); | ||
return a.getContent() > b.getContent() ? -1 : ( | ||
a.getContent() < b.getContent() ? 1 : 0 | ||
); | ||
}, | ||
@@ -130,7 +126,5 @@ add: { | ||
list.setSortingCallback( function ( a, b ) { | ||
return a.getContent() > b.getContent() ? 1 : | ||
( | ||
a.getContent() < b.getContent() ? -1 : | ||
0 | ||
); | ||
return a.getContent() > b.getContent() ? 1 : ( | ||
a.getContent() < b.getContent() ? -1 : 0 | ||
); | ||
} ); | ||
@@ -206,7 +200,5 @@ | ||
list.setSortingCallback( function ( a, b ) { | ||
return a.getContent() > b.getContent() ? -1 : | ||
( | ||
a.getContent() < b.getContent() ? 1 : | ||
0 | ||
); | ||
return a.getContent() > b.getContent() ? -1 : ( | ||
a.getContent() < b.getContent() ? 1 : 0 | ||
); | ||
} ); | ||
@@ -213,0 +205,0 @@ list.items[ 1 ].content = 'ee'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18
281395
6983
4