Skip to content

Commit

Permalink
Merge pull request #4 from Benjaminsen/pr/2
Browse files Browse the repository at this point in the history
Merge to support NFE.
  • Loading branch information
Benjaminsen committed Apr 20, 2014
2 parents 0d00915 + f834531 commit ba139ce
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bin/extend.js.license.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ExtendJS
More info at http://extendjs.org

Copyright (c) 2013 ChrisBenjaminsen.com
Copyright (c) 2013+ ChrisBenjaminsen.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions bin/extend.min.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
ExtendJS 0.2.1
ExtendJS 0.2.2
More info at http://extendjs.org
Copyright (c) 2013 ChrisBenjaminsen.com
Copyright (c) 2013+ ChrisBenjaminsen.com
Distributed under the terms of the MIT license.
http://extendjs.org/licence.txt
This notice shall be included in all copies or substantial portions of the Software.
*/
!function(){function t(r){r.parent instanceof Function&&(t.apply(this,[r.parent]),this.super=n(this,i(this,this.constructor))),r.apply(this,arguments)}function n(t,n){for(var r in t)"super"!==r&&t[r]instanceof Function&&(n[r]=t[r].super||i(t,t[r]));return n}function i(t,n){var i=t.super;return n.super=function(){return t.super=i,n.apply(t,arguments)}}this.Class=function(){},Class.extend=function(i){function r(){t!==arguments[0]&&(t.apply(this,[i]),n(this,this),this.initializer instanceof Function&&this.initializer.apply(this),this.constructor.apply(this,arguments))}r.prototype=new this(t),r.prototype.constructor=r,r.toString=function(){return""+i};var s=arguments.callee;return r.extend=function(t){return t.parent=i,s.apply(r,arguments)},r},Class=Class.extend(function(){this.constructor=function(){}})}()
!function(a){"use strict";function b(a){a.parent instanceof Function&&(b.apply(this,[a.parent]),this.super=c(this,d(this,this.constructor))),a.apply(this,arguments)}function c(a,b){for(var c in a)"super"!==c&&a[c]instanceof Function&&(b[c]=a[c].super||d(a,a[c]));return b}function d(a,b){var c=a.super;return b.super=function(){return a.super=c,b.apply(a,arguments)}}a.Class=function(){},a.Class.extend=function e(a){function d(){b!==arguments[0]&&(b.apply(this,[a]),c(this,this),this.initializer instanceof Function&&this.initializer.apply(this),this.constructor.apply(this,arguments))}return d.prototype=new this(b),d.prototype.constructor=d,d.toString=function(){return a.toString()},d.extend=function(b){return b.parent=a,e.apply(d,arguments)},d},a.Class=a.Class.extend(function(){this.constructor=function(){}})}(this);
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extend.js",
"version": "0.2.1",
"version": "0.2.2",
"main": [
"src/extend.js"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extend.js",
"version": "v0.2.1",
"version": "v0.2.2",
"description": "ExtendJS extends JavaScript with a simple yet powerful class abstraction",
"main": "src/extend.js",
"repository": {
Expand Down
18 changes: 10 additions & 8 deletions src/extend.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
ExtendJS 0.2.1
ExtendJS 0.2.2
More info at http://extendjs.org
Copyright (c) 2013 ChrisBenjaminsen.com
Copyright (c) 2013+ ChrisBenjaminsen.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -22,7 +22,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
(function(){
(function(global){
"use strict";
//Helper method for creating an super copied object clone
function initialize(method){
//Recursivly execute parent methods.
Expand Down Expand Up @@ -55,8 +56,8 @@
}

//Create Class object
this.Class = function(){};
Class.extend = function(to){
global.Class = function(){};
global.Class.extend = function ext(to){
function child(){
//Prevent the prototype scope set executing the constructor.
if(initialize !== arguments[0]){
Expand All @@ -80,7 +81,6 @@
}

//Allow the child to be extended.
var ext = arguments.callee;
child.extend = function(target){
//Create parent referance and inherentence path.
target.parent = to;
Expand All @@ -90,5 +90,7 @@
return child
}
//Bootstrap Class by inheriting itself with empty constructor.
Class = Class.extend(function(){this.constructor=function(){}});
})()
global.Class = global.Class.extend(function() {
this.constructor=function(){}
});
})(this)
6 changes: 3 additions & 3 deletions tests/extend.min.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
ExtendJS 0.2.1
ExtendJS 0.2.2
More info at http://extendjs.org
Copyright (c) 2013 ChrisBenjaminsen.com
Copyright (c) 2013+ ChrisBenjaminsen.com
Distributed under the terms of the MIT license.
http://extendjs.org/licence.txt
This notice shall be included in all copies or substantial portions of the Software.
*/
!function(){function t(r){r.parent instanceof Function&&(t.apply(this,[r.parent]),this.super=n(this,i(this,this.constructor))),r.apply(this,arguments)}function n(t,n){for(var r in t)"super"!==r&&t[r]instanceof Function&&(n[r]=t[r].super||i(t,t[r]));return n}function i(t,n){var i=t.super;return n.super=function(){return t.super=i,n.apply(t,arguments)}}this.Class=function(){},Class.extend=function(i){function r(){t!==arguments[0]&&(t.apply(this,[i]),n(this,this),this.initializer instanceof Function&&this.initializer.apply(this),this.constructor.apply(this,arguments))}r.prototype=new this(t),r.prototype.constructor=r,r.toString=function(){return""+i};var s=arguments.callee;return r.extend=function(t){return t.parent=i,s.apply(r,arguments)},r},Class=Class.extend(function(){this.constructor=function(){}})}()
!function(a){"use strict";function b(a){a.parent instanceof Function&&(b.apply(this,[a.parent]),this.super=c(this,d(this,this.constructor))),a.apply(this,arguments)}function c(a,b){for(var c in a)"super"!==c&&a[c]instanceof Function&&(b[c]=a[c].super||d(a,a[c]));return b}function d(a,b){var c=a.super;return b.super=function(){return a.super=c,b.apply(a,arguments)}}a.Class=function(){},a.Class.extend=function e(a){function d(){b!==arguments[0]&&(b.apply(this,[a]),c(this,this),this.initializer instanceof Function&&this.initializer.apply(this),this.constructor.apply(this,arguments))}return d.prototype=new this(b),d.prototype.constructor=d,d.toString=function(){return a.toString()},d.extend=function(b){return b.parent=a,e.apply(d,arguments)},d},a.Class=a.Class.extend(function(){this.constructor=function(){}})}(this);

0 comments on commit ba139ce

Please sign in to comment.