Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
chore: remove unused createObject fn
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Feb 28, 2014
1 parent eb5ee79 commit ba3da96
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/NodeBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@
return typeof node.getElementById === 'function' ? node : null;
}

// JScript does not have __proto__. We wrap all object literals with
// createObject which uses Object.create, Object.defineProperty and
// Object.getOwnPropertyDescriptor to create a new object that does the exact
// same thing. The main downside to this solution is that we have to extract
// all those property descriptors for IE.
var createObject = ('__proto__' in {}) ?
function(obj) { return obj; } :
function(obj) {
var proto = obj.__proto__;
if (!proto)
return obj;
var newObject = Object.create(proto);
Object.getOwnPropertyNames(obj).forEach(function(name) {
Object.defineProperty(newObject, name,
Object.getOwnPropertyDescriptor(obj, name));
});
return newObject;
};

// IE does not support have Document.prototype.contains.
if (typeof document.contains != 'function') {
Expand Down

0 comments on commit ba3da96

Please sign in to comment.