Update OOjs to v1.0.7-pre (9c04f3e917)
c723873 package.json: Set npm dependencies at fixed versions d27e989 Set up node-jscs, pass it, and configure in local Gruntfile e284c5f Update build notice and licence file for 2014 81d0f4a Tag v1.0.7 7b20b8a package.json: Update devDependencies 6c47d42 Implement generateDocs.sh script 9c04f3e core: Add a 'super' property to inheriting classes Change-Id: I4c9d0bceed00ed290ac2454b54abe2e53a46857c
This commit is contained in:
parent
c2812ac081
commit
c277f452c1
1 changed files with 25 additions and 21 deletions
|
|
@ -1,12 +1,12 @@
|
|||
/*!
|
||||
* OOjs v1.0.6
|
||||
* OOjs v1.0.7-pre (9c04f3e917)
|
||||
* https://www.mediawiki.org/wiki/OOjs
|
||||
*
|
||||
* Copyright 2011-2013 OOjs Team and other contributors.
|
||||
* Copyright 2011-2014 OOjs Team and other contributors.
|
||||
* Released under the MIT license
|
||||
* http://oojs.mit-license.org
|
||||
*
|
||||
* Date: Tue Dec 10 2013 22:43:42 GMT+0100 (CET)
|
||||
* Date: Fri Feb 14 2014 17:51:43 GMT-0800 (PST)
|
||||
*/
|
||||
( function ( global ) {
|
||||
|
||||
|
|
@ -23,7 +23,6 @@ var
|
|||
|
||||
/* Class Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Assert whether a value is a plain object or not.
|
||||
*
|
||||
|
|
@ -64,23 +63,27 @@ oo.isPlainObject = function ( obj ) {
|
|||
* multiple constructors consider storing an instance of the other constructor in a
|
||||
* property instead, or perhaps use a mixin (see oo.mixinClass).
|
||||
*
|
||||
* function Foo() {}
|
||||
* Foo.prototype.jump = function () {};
|
||||
* function Thing() {}
|
||||
* Thing.prototype.exists = function () {};
|
||||
*
|
||||
* function FooBar() {}
|
||||
* oo.inheritClass( FooBar, Foo );
|
||||
* FooBar.prop.feet = 2;
|
||||
* FooBar.prototype.walk = function () {};
|
||||
* function Person() {
|
||||
* this.constructor.super.apply( this, arguments );
|
||||
* }
|
||||
* oo.inheritClass( Person, Thing );
|
||||
* Person.static.defaultEyeCount = 2;
|
||||
* Person.prototype.walk = function () {};
|
||||
*
|
||||
* function FooBarQuux() {}
|
||||
* OO.inheritClass( FooBarQuux, FooBar );
|
||||
* FooBarQuux.prototype.jump = function () {};
|
||||
* function Jumper() {
|
||||
* this.constructor.super.apply( this, arguments );
|
||||
* }
|
||||
* OO.inheritClass( Jumper, Person );
|
||||
* Jumper.prototype.jump = function () {};
|
||||
*
|
||||
* FooBarQuux.prop.feet === 2;
|
||||
* var fb = new FooBar();
|
||||
* fb.jump();
|
||||
* fb.walk();
|
||||
* fb instanceof Foo && fb instanceof FooBar && fb instanceof FooBarQuux;
|
||||
* Jumper.static.defaultEyeCount === 2;
|
||||
* var x = new Jumper();
|
||||
* x.jump();
|
||||
* x.walk();
|
||||
* x instanceof Thing && x instanceof Person && x instanceof Jumper;
|
||||
*
|
||||
* @method
|
||||
* @param {Function} targetFn
|
||||
|
|
@ -94,6 +97,7 @@ oo.inheritClass = function ( targetFn, originFn ) {
|
|||
|
||||
var targetConstructor = targetFn.prototype.constructor;
|
||||
|
||||
targetFn.super = originFn;
|
||||
targetFn.prototype = Object.create( originFn.prototype, {
|
||||
// Restore constructor property of targetFn
|
||||
constructor: {
|
||||
|
|
@ -502,9 +506,9 @@ oo.EventEmitter.prototype.on = function ( event, callback, args, context ) {
|
|||
}
|
||||
// Add binding
|
||||
bindings.push( {
|
||||
'callback': callback,
|
||||
'args': args,
|
||||
'context': context
|
||||
callback: callback,
|
||||
args: args,
|
||||
context: context
|
||||
} );
|
||||
return this;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue