Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Incorporated recommendations from kangax for Object.create.

  • Loading branch information...
commit 8c54a63279a41136f10dc0918d0f417d68031618 1 parent 6498589
@kriskowal kriskowal authored
Showing with 9 additions and 5 deletions.
  1. +6 −0 CHANGES
  2. +2 −4 es5-shim.js
  3. +1 −1  package.json
View
6 CHANGES
@@ -1,4 +1,10 @@
+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
View
6 es5-shim.js
@@ -257,13 +257,11 @@ if (!Object.create) {
Object.create = function(prototype, properties) {
var object;
if (prototype === null) {
- object = {};
- if (object.__proto__)
- object.__proto__ = null;
+ object = {"__proto__": null};
} else {
if (typeof prototype != "object")
throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
- function Type() {};
+ var Type = function () {};
Type.prototype = prototype;
object = new Type();
}
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "es5-shim",
"description": "ES5 as implementable on previous engines",
- "version": "0.0.1",
+ "version": "0.0.2",
"homepage": "http://github.com/kriskowal/es5-shim/",
"author": "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"bugs": {
Please sign in to comment.
Something went wrong with that request. Please try again.