Comparing version 1.0.2 to 1.0.3
@@ -42,2 +42,8 @@ /** | ||
if (!Object.getPrototypeOf) { | ||
Object.getPrototypeOf = function (object) { | ||
return object.proto || object.constructor.prototype; | ||
}; | ||
} | ||
define(function () | ||
@@ -44,0 +50,0 @@ { |
{ | ||
"name": "uberproto", | ||
"description": "JavaScript object inheritance sugar: Easy extension, mixins, super methods, proxies", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"homepage": "http://daffl.github.com/uberproto", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -1,3 +0,3 @@ | ||
(function(){typeof define=="undefined"&&(define=function(a){a=a();typeof exports=="undefined"?Proto=a:module.exports=a});if(!Object.create)Object.create=function(a){function b(){}if(arguments.length>1)throw Error("Object.create implementation only accepts the first parameter.");b.prototype=a;return new b};define(function(){return{create:function(){var a=Object.create(this),b=typeof a.__init==="string"?a.__init:"init";typeof a[b]=="function"&&a[b].apply(a,arguments);return a},mixin:function(a,b){var d= | ||
b||this,g=/xyz/.test(function(){})?/\b_super\b/:/.*/,f=Object.getPrototypeOf(d)||d.prototype,e,c;for(c in a)e=d[c],d[c]=typeof a[c]=="function"&&typeof f[c]=="function"&&g.test(a[c])||typeof e=="function"&&typeof a[c]=="function"?function(a,b,c){return function(){var d=this._super;this._super=typeof a=="function"?a:f[b];var e=c.apply(this,arguments);this._super=d;return e}}(e,c,a[c]):a[c];return d},extend:function(a,b){return this.mixin(a,Object.create(b||this))},proxy:function(a,b){var d=b||this; | ||
return function(){return d[a].apply(d,arguments)}}}})})(); | ||
(function(){"undefined"==typeof define&&(define=function(a){a=a();"undefined"==typeof exports?Proto=a:module.exports=a});Object.create||(Object.create=function(a){function b(){}if(1<arguments.length)throw Error("Object.create implementation only accepts the first parameter.");b.prototype=a;return new b});Object.getPrototypeOf||(Object.getPrototypeOf=function(a){return a.proto||a.constructor.prototype});define(function(){return{create:function(){var a=Object.create(this),b=typeof a.__init==="string"? | ||
a.__init:"init";typeof a[b]=="function"&&a[b].apply(a,arguments);return a},mixin:function(a,b){var d=b||this,g=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,f=Object.getPrototypeOf(d)||d.prototype,e,c;for(c in a){e=d[c];d[c]=typeof a[c]=="function"&&typeof f[c]=="function"&&g.test(a[c])||typeof e=="function"&&typeof a[c]=="function"?function(a,b,c){return function(){var d=this._super;this._super=typeof a=="function"?a:f[b];var e=c.apply(this,arguments);this._super=d;return e}}(e,c,a[c]):a[c]}return d}, | ||
extend:function(a,b){return this.mixin(a,Object.create(b||this))},proxy:function(a,b){var d=b||this;return function(){return d[a].apply(d,arguments)}}}})})(); |
@@ -0,1 +1,3 @@ | ||
# Uberproto | ||
Uberproto is a simple base object that adds some sugar to ECMAScript 5 style object inheritance | ||
@@ -102,3 +104,3 @@ in JavaScript. | ||
} | ||
}; | ||
}); | ||
@@ -223,1 +225,25 @@ For calling the constructor on a plain object, call *create* on an UberProto object: | ||
* Initial stable release | ||
## License | ||
Copyright (C) 2012 David Luecke daff@neyeon.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 | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
[![Build Status](https://secure.travis-ci.org/daffl/uberproto.png)](http://travis-ci.org/daffl/uberproto) |
Sorry, the diff of this file is not supported yet
248
96697
18
2100