Skip to content

Commit ba139ce

Browse files
committed
Merge pull request #4 from Benjaminsen/pr/2
Merge to support NFE.
2 parents 0d00915 + f834531 commit ba139ce

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

bin/extend.js.license.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ExtendJS
22
More info at http://extendjs.org
33

4-
Copyright (c) 2013 ChrisBenjaminsen.com
4+
Copyright (c) 2013+ ChrisBenjaminsen.com
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

bin/extend.min.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
ExtendJS 0.2.1
2+
ExtendJS 0.2.2
33
More info at http://extendjs.org
44
5-
Copyright (c) 2013 ChrisBenjaminsen.com
5+
Copyright (c) 2013+ ChrisBenjaminsen.com
66
77
Distributed under the terms of the MIT license.
88
http://extendjs.org/licence.txt
99
1010
This notice shall be included in all copies or substantial portions of the Software.
1111
*/
12-
!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(){}})}()
12+
!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);

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extend.js",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"main": [
55
"src/extend.js"
66
],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extend.js",
3-
"version": "v0.2.1",
3+
"version": "v0.2.2",
44
"description": "ExtendJS extends JavaScript with a simple yet powerful class abstraction",
55
"main": "src/extend.js",
66
"repository": {

src/extend.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
ExtendJS 0.2.1
2+
ExtendJS 0.2.2
33
More info at http://extendjs.org
44
5-
Copyright (c) 2013 ChrisBenjaminsen.com
5+
Copyright (c) 2013+ ChrisBenjaminsen.com
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,8 @@
2222
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
THE SOFTWARE.
2424
*/
25-
(function(){
25+
(function(global){
26+
"use strict";
2627
//Helper method for creating an super copied object clone
2728
function initialize(method){
2829
//Recursivly execute parent methods.
@@ -55,8 +56,8 @@
5556
}
5657

5758
//Create Class object
58-
this.Class = function(){};
59-
Class.extend = function(to){
59+
global.Class = function(){};
60+
global.Class.extend = function ext(to){
6061
function child(){
6162
//Prevent the prototype scope set executing the constructor.
6263
if(initialize !== arguments[0]){
@@ -80,7 +81,6 @@
8081
}
8182

8283
//Allow the child to be extended.
83-
var ext = arguments.callee;
8484
child.extend = function(target){
8585
//Create parent referance and inherentence path.
8686
target.parent = to;
@@ -90,5 +90,7 @@
9090
return child
9191
}
9292
//Bootstrap Class by inheriting itself with empty constructor.
93-
Class = Class.extend(function(){this.constructor=function(){}});
94-
})()
93+
global.Class = global.Class.extend(function() {
94+
this.constructor=function(){}
95+
});
96+
})(this)

tests/extend.min.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
ExtendJS 0.2.1
2+
ExtendJS 0.2.2
33
More info at http://extendjs.org
44
5-
Copyright (c) 2013 ChrisBenjaminsen.com
5+
Copyright (c) 2013+ ChrisBenjaminsen.com
66
77
Distributed under the terms of the MIT license.
88
http://extendjs.org/licence.txt
99
1010
This notice shall be included in all copies or substantial portions of the Software.
1111
*/
12-
!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(){}})}()
12+
!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 commit comments

Comments
 (0)