diff --git a/.gitmodules b/.gitmodules
index 566bd4f..289ca75 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "lib/es5-shim"]
- path = lib/es5-shim
- url = git://github.com/kriskowal/es5-shim.git
[submodule "build/html"]
path = build/html
url = git://github.com/quadroid/clonejs.git
diff --git a/.version b/.version
index 4c9c442..d0a68ee 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-v0.7.4-beta
\ No newline at end of file
+v1.0.0-alpha
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2d87146..428adf7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-### Build v0.7.4-beta (2013-04-14 09:06)
+##### Build v0.7.4 (2013-04-14 09:06)
* add ability to inject into Object.prototype, update module interface
* change namespace interface
* add RequireJS support
@@ -7,21 +7,21 @@
* improve documentation
* refactor tests
-### Build v0.7.3-beta (2013-04-12 06:00)
+##### Build v0.7.3 (2013-04-12 06:00)
* improve documentation
* fix bug: first call applySuper() on sealed object
* optimize `for`
* deploy scripts: add comments
-### Build v0.7.2-05-beta (2013-04-06 15:35)
+###### Build v0.7.2-05 (2013-04-06 15:35)
* reverse changelog items order
* deploy scripts: fix new line in build message
* fix cdn src
-### Build v0.7.2-04-beta (2013-04-06 14:35)
+###### Build v0.7.2-04 (2013-04-06 14:35)
* update documentation
-### Build v0.7.2-03-beta (2013-04-01 12:06)
+###### Build v0.7.2-03 (2013-04-01 12:06)
* fix bug in getKeys(), forEach()
* add getValues() test
* add getSuper()
@@ -31,11 +31,11 @@
* update describe() test
* fix applySuper() bug
-### Build v0.7.2-02-beta (2013-03-30 22:06)
+###### Build v0.7.2-02 (2013-03-30 22:06)
* fix home page nav
* incrase CI speed
-### Build 0.7.2.01 (2013-03-30 15:32)
+###### Build v0.7.2-01 (2013-03-30 15:32)
* fix deploy scripts
* jsdoc template: update DL's formatting
* edit readme
diff --git a/README.md b/README.md
index a9315d9..9eed8bb 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,42 @@
-## [clone.js](http://clonejs.org) [![Build Status](https://travis-ci.org/quadroid/clonejs.png?branch=master "travis-ci.org")](https://travis-ci.org/quadroid/clonejs)
-[API documentation](http://clonejs.org/symbols/%24object.html)
+## CloneJS [![Build Status](https://travis-ci.org/quadroid/clonejs.png?branch=master "travis-ci.org")](https://travis-ci.org/quadroid/clonejs) [![NPM version](https://badge.fury.io/js/clonejs.png)](http://badge.fury.io/js/clonejs)
+[**CloneJS.org**](http://clonejs.org)
+| [API documentation](http://clonejs.org/symbols/clone.html)
| [ChangeLog](https://github.com/quadroid/clonejs/blob/master/CHANGELOG.md)
-| [GitHub](http://github.com/quadroid/clonejs)
+*| [GitHub](http://github.com/quadroid/clonejs)
| [NPM package](http://npmjs.org/package/clonejs)
-| [Travis CI](http://travis-ci.org/quadroid/clonejs)
+| [Travis CI](http://travis-ci.org/quadroid/clonejs)*
+
+**This framework provides:**
-This is the micro-framework that based on the ECMA Script 5 features like [Object.create⠙][] and [property descriptors⠙][Object.defineProperty⠙].
+* Speed! It's extrimerly fast!
+* Class-less, the pure prototype-oriented paradigm.
+* Separate all your objects and classes to state (data) and behavior (methods).
+* [Lazy initialization⠙][] support (by `__inits__` behavior).
+* IE6+ support! Shims `Object.create` and `Object.getPrototypeOf` methods.
-##### Try the true [prototype-based OOP⠙](http://en.wikipedia.org/wiki/Prototype-based_programming)
+[Lazy initialization⠙]: http://en.wikipedia.org/wiki/Lazy_initialization
-**It's trivial to create new "classes"** - just clone the prototype and change a couple of properties and voila... new "class".
+The main code of the framework:
-**It's really class-free**: do you know the difference between js constructor-functions and classes in other languages?
-`$object.clone` produces prototype objects, not function-constructors, unlike other class-producing tools (`Backbone.Model.extend`, `Ext.define`, `dojo.declare`).
+ function clone(/** Object! */obj, /** object! */state, /** object= */behavior$){
+ if( behavior$ ){
+ behavior$.__proto__ = obj;
+ state.__proto__ = behavior$;
+ }else{
+ state.__proto__ = obj;
+ }
+ return state;
+ }
+
+Thats it!
+
+#### Try the true [prototype-based OOP⠙](http://en.wikipedia.org/wiki/Prototype-based_programming)
+
+**It's trivial to create new "classes"** - just clone the object and change a couple of properties and voila... new "class".
+
+**It's really class-free**: `clone` produces prototype objects, not function-constructors, unlike other class-producing tools (`Ext.define`, `dojo.declare`).
In this framework you can easilly create and manipulate objects without constructors, instead of classic js way,
where you should define a constructor for every object (that you want to use as prototype), even if you didn't need it.
@@ -31,207 +53,75 @@ Node.js:
npm install clonejs
-[CDN⠙][] for client-side (~3 KB gzipped):
+[CDN⠙][] for client-side:
### Usage
- //
- var clonejs = require('clonejs'),
- $object = clonejs.$object;
- //or: var $object = require('clonejs').$object;
- //or: require('clonejs').inject();
- //
+ var clone = require('clonejs');//
/// Forget about classes.
// Instead of creating class (function), create prototype (object):
- var $duck = $object.clone({
- name: 'Unnamed',
+
+ var duck$ = {
quack: function(){
- console.log( this.name +' Duck: Quack-quack!');
+ console.log( this.name +" Duck: Quack-quack!");
}
- });
- $duck.quack();//Unnamed Duck: Quack-quack!
-
- /// Inheritance is simple:
- var $talkingDuck = $duck.clone({
+ };
+
+ /// Inheritance is simple (talkingDuck$ extends duck$):
+
+ var talkingDuck$ = clone(duck$, {
quack: function(){
- this.applySuper('quack');
- console.log('My name is '+ this.name +'!');
- }
+ duck$.quack.call(this);
+ console.log("My name is "+ this.name +"!");
+ }
});
- /// Forget about the `new` operator, use .create() method instead:
- var donald = $talkingDuck.create({name: 'Donald'});
- donald.quack();// Donald Duck: Quack-quack! My name is Donald!
+ /// Forget about the `new` operator, use clone to create instances:
+
+ var donald = clone(talkingDuck$, {name: "Donald"});
+ donald.quack();// Donald Duck: Quack-quack!
+ // My name is Donald!
+ var daffy = clone(talkingDuck$, {name: "Daffy"});
+ daffy.quack(); // Daffy Duck: Quack-quack!
+ // My name is Daffy!
/// Forget about the `instanceof` operator, use JS native
// .isPrototypeOf() method instead:
- $duck.isPrototypeOf(donald);// true
-
-
-
-###### Cloning objects:
-
- var $proto = $object.clone({a:1, b:2, c:3});
-
- /// clone:
- var clone = $proto.clone();
- clone.a = 11; // $proto.a not changed
- $proto.b = 22; // clone.b will be also changed to 22
-
- /// copy:
- var copy = $proto.copy();
- copy.a = 111;// $proto.a not changed
- $proto.b = 222;// copy.b not changed
- /// create:
- var instance = $proto.create({d: 4444});
- instance.a = 1111;// $proto.a not changed
- $proto.b = 2222;// like clone, instance.b will be also changed to 2222
- assert( instance.a === 1111 );
- assert( instance.d === 4444 );
-
-See: [clone][], [copy][], [create][], [deepCopy][], [deepClone][].
-
-###### Property modificators:
-
- var $myType = $object.clone({
- '(final) property1': "not configurable and not writable",
- '(writable final) property2': "not configurable only",
- '(hidden) property3': "not enumerable",
- '(const) constant': "not writable",
- property4 : "simple property",
- '(get) property3alias': 'property3',// automatically create getter
- _item : "private property (not enumerable)",
- '(get) item': function() { return this._item },
- '(set) item': function(v){ this._item = v },
- constructor : 'MyType'
- });
- assert( $myType.property3alias === $myType.property3 );
-
-See: [describe][].
-
-###### Inheritance & constructors:
-
- var $parent = $object.clone({
- constructor: function Parent(){
- this.applySuper();
- console.log('$parent constructor arguments:', arguments);
- }
- });
-
- var $child = $parent.clone({
- constructor: function Child(arg1, arg2){
- this.callSuper('constructor', arg1, arg2);
- console.log('$child constructor arguments:', arguments);
- }
- });
-
- var $grandchild = $child.clone({
- constructor: function Grandchild(){
- this.applySuper(arguments);
- console.log('$grandchild constructor arguments:', arguments);
- }
- });
-
- var myBoy = $grandchild.create(1,2,3);
- /// console log:
- // $parent constructor arguments: [1,2]
- // $child constructor arguments: [1,2,3]
- // $grandchild constructor arguments: [1,2,3]
-
- assert( $child.isPrototypeOf(myBoy) );
+ duck$.isPrototypeOf(donald);// true
-See: [constructor][], [create][], [applySuper][], [callSuper][], [createSuperSafeCallback][].
-
-###### Properties iteration:
-
- var $obj = $object.clone({a: 11, b: 22, c: 33}),
- obj = $obj.create({d: 44});
-
- /// Map only own properties (default):
-
- var mappedObj1 = obj.map(function(value){return 100 + value});
- // mappedObj1 == {d: 144}
- /// Map all properties, replace default (`$object`) prototype of returned object:
-
- var proto = {e: 55};
- var mappedObj2 = obj.map(function(value){return 100 + value}, obj, false, proto);
- // mappedObj2 == {a: 111, b: 122, c: 133, d: 144, e: 155}
- proto.f = 66;
- // mappedObj2 == {a: 111, b: 122, c: 133, d: 144, e: 155, f: 66}
-
-See: [forEach][], [map][], [filter][], [every][], [some][].
-
-###### Namespaces:
-
- var app = clonejs.$namespace.create();
-
- /// create namespace item `app.collections`
-
- app.extend('collections', {
- $item: {},
- _items: {}
- });
+###### Lazy initialization:
- /// create namespace item `app.collections.arrayCollections`
+Instead of defining in constructor, you can initialize your properties separetly.
+Lazy initialization is the tactic, that will initialize property in first use of them.
- app.collections.extend('arrayCollections', {_items: []});
-
- /// create namespace item `app.models.users`
-
- var $users = app.collections.$arrayCollections.clone({
- $item: {name: '', isAdmin: false},
- constructor: function Users(items){
- items.forEach(function(item){
- var newItem = $object.create.call(this.$item, item);
- this._items.push(newItem);
- }, this);
+ var obj = clone.create({
+ name: "Default Name"
+ },{
+ __inits__: {
+ lazy: function(){
+ console.log("Lazy initialization...");
+ return this.name +": Lazy initiated.":
+ }
}
});
- app.put('models.users', $users);
-
- /// use namespace:
-
- var users = app.models.$users.create([{name: 'User1'}]);
-
-See: [$namespace][], [$namespace.extend][], [$namespace.put][].
-
-
+ console.log( obj.lazy );
+ // Lazy initialization...
+ // Default Name: Lazy initiated.
+
+ console.log( obj.lazy );// initializer don't run again
+ // Default Name: Lazy initiated.
[Object.create⠙]: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create
[Object.defineProperty⠙]: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty
+[property descriptors⠙]: http://ejohn.org/blog/ecmascript-5-objects-and-properties/#ig-sh-1
[CDN⠙]: http://code.lancepollard.com/github-as-a-cdn/
-[$object]: http://clonejs.org/symbols/%24object.html
-
-[clone]: http://clonejs.org/symbols/%24object.html#clone
-[create]: http://clonejs.org/symbols/%24object.html#create
-[copy]: http://clonejs.org/symbols/%24object.html#copy
-[deepCopy]: http://clonejs.org/symbols/%24object.html#deepCopy
-[deepClone]: http://clonejs.org/symbols/%24object.html#deepClone
-
-[describe]: http://clonejs.org/symbols/%24object.html#.describe
-
-[forEach]: http://clonejs.org/symbols/%24object.html#forEach
-[every]: http://clonejs.org/symbols/%24object.html#every
-[some]: http://clonejs.org/symbols/%24object.html#some
-[map]: http://clonejs.org/symbols/%24object.html#map
-[filter]: http://clonejs.org/symbols/%24object.html#filter
-
-[constructor]: http://clonejs.org/symbols/%24object.html#constructor
-[applySuper]: http://clonejs.org/symbols/%24object.html#applySuper
-[callSuper]: http://clonejs.org/symbols/%24object.html#callSuper
-[createSuperSafeCallback]: http://clonejs.org/symbols/%24object.html#createSuperSafeCallback
-
-[$namespace]: http://clonejs.org/symbols/$namespace.html
-[$namespace.extend]: http://clonejs.org/symbols/$namespace.html#extend
-[$namespace.put]: http://clonejs.org/symbols/$namespace.html#put
-
![yandex metrika](http://mc.yandex.ru/watch/20738752)
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/3110be9614da5cb337ebd483c187010f "githalytics.com")](http://githalytics.com/quadroid/clonejs)
diff --git a/build/clone.min.js b/build/clone.min.js
index 054dc86..6763121 100644
--- a/build/clone.min.js
+++ b/build/clone.min.js
@@ -1,19 +1,6 @@
-'use strict';(function(n){function t(){Object.defineProperties(Object.prototype,f.describe(f));f=Object.prototype;Object.defineProperty(p,"$object",{value:f})}var f={clone:function(k,h){if(arguments.length)var c=f.describe.apply(this,arguments);return Object.create(this,c)},create:function(f,h){var c=this.clone();return c.constructor.apply(c,arguments)||c},constructor:function(f,h){if("object"==typeof f)this.defineProperties(f,h);else if(arguments.length)return Object(f)},describe:function(f,h){var c=
-{},a=h?h:{configurable:!0,enumerable:!0,writable:!0},d=!(h&&h.enumerable),b;for(b in f){var e=f[b],g=Object.create(a);if("("==b[0]){var i=b.match(/^\((((get|set|const|hidden|final|writable) *)+)\) +(.+)$/);if(i){var j=i[1].split(" ").sort();b=i[4];c[b]&&(g=c[b]);for(var m in j)switch(j[m]){case "const":g.writable=!1;break;case "final":g.configurable=!1;g.writable=!1;break;case "get":g.get=e;break;case "hidden":g.enumerable=!1;break;case "set":g.set=e;break;case "writable":g.writable=!0}}}if(g.get||
-g.set){if("string"==typeof e){var r=e;"string"==typeof g.get?g.get=function(){return this[r]}:g.set=function(a){this[r]=a}}g.value=void 0;g.get&&(e=void 0)}else g.value=e;if(d&&"function"==typeof e||"_"==b[0])g.enumerable=!1;b.toUpperCase()==b&&(g.writable=!1);c[b]=g}c.hasOwnProperty("constructor")&&(a=c.constructor.value,"string"==typeof a?(d=a,a=Function("return function "+d+"(){return this.applySuper(arguments)}")(),a.typeName=d,c.constructor.value=a):a.typeName||(a.typeName=a.name||"CloneOf"+
-this.constructor.typeName),a.prototype=this,c.constructor.enumerable=!1);return c},applySuper:function(f,h){"string"!=typeof f&&(h=f,f="constructor");"__super__"in this||this.getSuper(!0);var c=this.__super__;this.__super__=Object.getPrototypeOf(c);var a=c[f].apply(this,h);this.__super__=c;return a},callSuper:function(f,h,c){var a=Array.prototype.slice.call(arguments,1);return this.applySuper(f,a)},getSuper:function(f){var h=Object.getPrototypeOf(Object.getPrototypeOf(this));f&&this.defineProperty("__super__",
-{value:h,writable:!0,configurable:!0});return h},createSuperSafeCallback:function(f,h){if("string"==typeof f){var c=this[f];"undefined"==typeof h&&(h=this)}else c=f;var a=this,d=this.__super__;return function(){if(a.__super__===d)return c.apply(h||this,arguments);var b=a.__super__;a.__super__=d;var e=c.apply(h||this,arguments);a.__super__=b;return e}},getState:function(k){for(var h=f.create(),k=k?Object.getOwnPropertyNames(this):Object.keys(this),c=0,a=k.length;c boilerplate
-
-1.2.2
- - Changed reduce to follow the letter of the spec with regard to having and
- owning properties.
- - Fixed a bug where RegExps pass as Functions in some engines in reduce.
-
-1.2.1
- - Adding few fixes to make jshint happy.
- - Fix for issue #12, function expressions can cause scoping issues in IE.
- - NPM will minify on install or when `npm run-script install` is executed.
- - Adding .gitignore to avoid publishing dev dependencies.
-
-1.2.0
- - Making script loadable as AMD module.
- - Adding `indexOf` to the list of safe shims.
-
-1.1.0
- - Added support for accessor properties where possible (which is all browsers
- except IE).
- - Stop exposing bound function's (that are returned by
- `Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`)
- as in some cases (when using facade objects for example) capabilities of the
- enclosed functions will be leaked.
- - `Object.create` now explicitly sets `__proto__` property to guarantee
- correct behavior of `Object.getPrototypeOf`'s on all objects created using
- `Object.create`.
- - Switched to `===` from `==` where possible as it's slightly faster on older
- browsers that are target of this lib.
- - Added names to all anonymous functions to have a better stack traces.
-
-1.0.0
- - fixed Date.toISODate, using UTC accessors, as in
- http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986
- (arian)
-
-0.0.4
- - Revised Object.getPrototypeOf to work in more cases
- in response to http://ejohn.org/blog/objectgetprototypeof/
- [issue #2] (fschaefer)
-
-0.0.3
- - Fixed typos in Object.keys (samsonjs)
-
-0.0.2
- Per kangax's recommendations:
- - faster Object.create(null)
- - fixed a function-scope function declaration statement in Object.create
-
-0.0.1
- - fixed Object.create(null), in so far as that's possible
- - reworked Rhino Object.freeze(Function) bug detector and patcher
-
-0.0.0
- - forked from narwhal-lib
-
diff --git a/lib/es5-shim/CONTRIBUTORS.md b/lib/es5-shim/CONTRIBUTORS.md
deleted file mode 100644
index 56959a6..0000000
--- a/lib/es5-shim/CONTRIBUTORS.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
-- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal
- Project)
-- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
-- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
-- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
-- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
-- kossnocorp Sasha Koss XXX TODO License or CLA
-- bryanforbes Bryan Forbes XXX TODO License or CLA
-- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
-- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD
- License
-- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
-- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
-- iwyg XXX TODO License or CLA
-- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
-- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License
-- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence
-- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
-- rwldrn Rick Waldron Copyright (C) 2011 MIT License
-- lexer Alexey Zakharov XXX TODO License or CLA
-- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.)
- Copyright (C) 2009 MIT License
-
diff --git a/lib/es5-shim/LICENSE b/lib/es5-shim/LICENSE
deleted file mode 100644
index fee0825..0000000
--- a/lib/es5-shim/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Copyright 2009, 2010 Kristopher Michael Kowal. All rights reserved.
-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.
diff --git a/lib/es5-shim/README.md b/lib/es5-shim/README.md
deleted file mode 100644
index 2972222..0000000
--- a/lib/es5-shim/README.md
+++ /dev/null
@@ -1,161 +0,0 @@
-
-`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to
-contain all EcmaScript 5 methods that can be faithfully emulated with a
-legacy JavaScript engine.
-
-`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as
-closely as possible. For these methods, as closely as possible to ES5
-is not very close. Many of these shams are intended only to allow code
-to be written to ES5 without causing run-time errors in older engines.
-In many cases, this means that these shams cause many ES5 methods to
-silently fail. Decide carefully whether this is what you want.
-
-
-## Tests
-
-The tests are written with the Jasmine BDD test framework.
-To run the tests, navigate to /tests/.
-
-In order to run against the shim-code, the tests attempt to kill the current
-implementation of the missing methods. This happens in /tests/helpers/h-kill.js.
-So in order to run the tests against the build-in methods, invalidate that file somehow
-(comment-out, delete the file, delete the script-tag, etc.).
-
-## Shims
-
-### Complete tests ###
-
-* Array.prototype.every
-* Array.prototype.filter
-* Array.prototype.forEach
-* Array.prototype.indexOf
-* Array.prototype.lastIndexOf
-* Array.prototype.map
-* Array.prototype.some
-* Array.prototype.reduce
-* Array.prototype.reduceRight
-* Array.isArray
-* Date.now
-* Date.prototype.toJSON
-* Function.prototype.bind
- * /!\ Caveat: the bound function's length is always 0.
- * /!\ Caveat: the bound function has a prototype property.
- * /!\ Caveat: bound functions do not try too hard to keep you
- from manipulating their ``arguments`` and ``caller`` properties.
- * /!\ Caveat: bound functions don't have checks in ``call`` and
- ``apply`` to avoid executing as a constructor.
-* Object.keys
-* String.prototype.trim
-
-### Untested ###
-
-* Date.parse (for ISO parsing)
-* Date.prototype.toISOString
-
-## Shams
-
-* /?\ Object.create
-
- For the case of simply "begetting" an object that
- inherits prototypically from another, this should work
- fine across legacy engines.
-
- /!\ Object.create(null) will work only in browsers that
- support prototype assignment. This creates an object
- that does not have any properties inherited from
- Object.prototype. It will silently fail otherwise.
-
- /!\ The second argument is passed to
- Object.defineProperties which will probably fail
- silently.
-
-* /?\ Object.getPrototypeOf
-
- This will return "undefined" in some cases. It uses
- __proto__ if it's available. Failing that, it uses
- constructor.prototype, which depends on the constructor
- property of the object's prototype having not been
- replaced. If your object was created like this, it
- won't work:
-
- function Foo() {
- }
- Foo.prototype = {};
-
- Because the prototype reassignment destroys the
- constructor property.
-
- This will work for all objects that were created using
- `Object.create` implemented with this library.
-
-* /!\ Object.getOwnPropertyNames
-
- This method uses Object.keys, so it will not be accurate
- on legacy engines.
-
-* Object.isSealed
-
- Returns "false" in all legacy engines for all objects,
- which is conveniently guaranteed to be accurate.
-
-* Object.isFrozen
-
- Returns "false" in all legacy engines for all objects,
- which is conveniently guaranteed to be accurate.
-
-* Object.isExtensible
-
- Works like a charm, by trying very hard to extend the
- object then redacting the extension.
-
-### Fail silently
-
-* /!\ Object.getOwnPropertyDescriptor
-
- The behavior of this shim does not conform to ES5. It
- should probably not be used at this time, until its
- behavior has been reviewed and been confirmed to be
- useful in legacy engines.
-
-* /!\ Object.defineProperty
-
- This method will silently fail to set "writable",
- "enumerable", and "configurable" properties.
-
- Providing a getter or setter with "get" or "set" on a
- descriptor will silently fail on engines that lack
- "__defineGetter__" and "__defineSetter__", which include
- all versions of IE up to version 8 so far.
-
- IE 8 provides a version of this method but it only works
- on DOM objects. Thus, the shim will not get installed
- and attempts to set "value" properties will fail
- silently on non-DOM objects.
-
- https://github.com/kriskowal/es5-shim/issues#issue/5
-
-* /!\ Object.defineProperties
-
- This uses the Object.defineProperty shim
-
-* Object.seal
-
- Silently fails on all legacy engines. This should be
- fine unless you are depending on the safety and security
- provisions of this method, which you cannot possibly
- obtain in legacy engines.
-
-* Object.freeze
-
- Silently fails on all legacy engines. This should be
- fine unless you are depending on the safety and security
- provisions of this method, which you cannot possibly
- obtain in legacy engines.
-
-* Object.preventExtensions
-
- Silently fails on all legacy engines. This should be
- fine unless you are depending on the safety and security
- provisions of this method, which you cannot possibly
- obtain in legacy engines.
-
diff --git a/lib/es5-shim/es5-sham.js b/lib/es5-shim/es5-sham.js
deleted file mode 100644
index 4602647..0000000
--- a/lib/es5-shim/es5-sham.js
+++ /dev/null
@@ -1,404 +0,0 @@
-// Copyright 2009-2012 by contributors, MIT License
-// vim: ts=4 sts=4 sw=4 expandtab
-
-// Module systems magic dance
-(function (definition) {
- // RequireJS
- if (typeof define == "function") {
- define(definition);
- // YUI3
- } else if (typeof YUI == "function") {
- YUI.add("es5-sham", definition);
- // CommonJS and
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-