Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/192877
Change subject: DON'T PUSH: update ooui-core to include .static.class property. ...................................................................... DON'T PUSH: update ooui-core to include .static.class property. This is patch I5b2e19b76dfead5b0e3055bdf11e86d22d53a99e, not yet merged. Change-Id: I10af41fad32a35e20581ebfe2c040f8c55726668 --- M lib/oojs.jquery.js 1 file changed, 12 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/77/192877/1 diff --git a/lib/oojs.jquery.js b/lib/oojs.jquery.js index 0b61721..5fe7ee8 100644 --- a/lib/oojs.jquery.js +++ b/lib/oojs.jquery.js @@ -1,12 +1,12 @@ /*! - * OOjs v1.1.4 optimised for jQuery + * OOjs v1.1.4-pre (c924234064) optimised for jQuery * https://www.mediawiki.org/wiki/OOjs * * Copyright 2011-2015 OOjs Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2015-01-23T20:11:25Z + * Date: 2015-02-25T20:38:41Z */ ( function ( global ) { @@ -34,7 +34,11 @@ * @param {Function} fn */ oo.initClass = function ( fn ) { + if ( fn.static && fn.static['class'] !== fn ) { + throw new Error( 'Class has mismatched static object' ); + } fn.static = fn.static || {}; + fn.static['class'] = fn; }; /** @@ -101,6 +105,7 @@ // Extend static properties - always initialize both sides oo.initClass( originFn ); targetFn.static = Object.create( originFn.static ); + targetFn.static['class'] = targetFn; }; /** @@ -148,7 +153,7 @@ oo.initClass( targetFn ); if ( originFn.static ) { for ( key in originFn.static ) { - if ( hasOwn.call( originFn.static, key ) ) { + if ( key !== 'class' && hasOwn.call( originFn.static, key ) ) { targetFn.static[key] = originFn.static[key]; } } @@ -622,11 +627,11 @@ */ oo.EventEmitter.prototype.once = function ( event, listener ) { var eventEmitter = this, - listenerWrapper = function () { - eventEmitter.off( event, listenerWrapper ); - listener.apply( eventEmitter, Array.prototype.slice.call( arguments, 0 ) ); + wrapper = function () { + eventEmitter.off( event, wrapper ); + return listener.apply( this, arguments ); }; - return this.on( event, listenerWrapper ); + return this.on( event, wrapper ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/192877 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10af41fad32a35e20581ebfe2c040f8c55726668 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Cscott <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
