Skip to content

Commit

Permalink
prepare patch for 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pocesar committed Jul 3, 2014
1 parent 187ad93 commit a1e4864
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
## 2.3.1
* Fixed bug that doesn't take in account the length of the current created function

## 2.3.0
* Fixed bug that makes `$include` apply descriptors correctly
* Added composition test
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name" : "es5class",
"main" : "index.js",
"version" : "2.3.0",
"version" : "2.3.1",
"homepage" : "https://github.com/pocesar/ES5-Class",
"authors" : [
"Paulo Cesar <email@pocesar.e4ward.com>"
Expand Down
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -42,14 +42,14 @@
return obj[key];
}

var fn = BetterCurry.wrap(superFn, context, superFn.__length, true);
var fn = BetterCurry.wrap(superFn, context, superFn.__length || obj[key].length, true);
fn.$currentContext = context;

var wrapped = function wrapped(){
var self = this;

if (fn.$currentContext !== self) {
fn = BetterCurry.wrap(superFn, self, fn.__length, true);
fn = BetterCurry.wrap(superFn, self, fn.__length || obj[key].length, true);
fn.$currentContext = self;
}

Expand Down Expand Up @@ -751,7 +751,7 @@
* @static
*/
Object.defineProperty(ES5Class, '$version', {
value: '2.3.0'
value: '2.3.1'
});

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "es5class",
"version": "2.3.0",
"version": "2.3.1",
"description": "Prototypal inheritance based on ES5 Object.create and Object.defineProperty for node.js and modern browsers",
"keywords": [
"es5",
Expand Down
22 changes: 22 additions & 0 deletions test/class-test.js
Expand Up @@ -411,6 +411,28 @@ describe('ES5Class', function (){
expect(main.Sub.$instanceOf(Sub)).to.be(true);
});

it('super construct', function(){
var
Base = ES5Class.$define('Base', {
construct: function(){
this.asdf = arguments[0];
}
}),
Sub = Base.$define('Sub', {
construct: function($super, asdf, ep) {
$super(asdf, ep);
}
}),
Ultra = Sub.$define('Ultra', {
construct: function($super) {
$super('asdf');
expect(this.asdf).to.be('asdf');
}
});

expect(Ultra.$create().asdf).to.be('asdf');
});

it('async $super', function (done){
var func = (typeof setImmediate === 'function' ? setImmediate : setTimeout);

Expand Down

0 comments on commit a1e4864

Please sign in to comment.