diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-04-30 18:30:11 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-04-30 18:30:11 +0200 |
commit | eb28c3b137c8a0d61377087c9a04b820151b0b7c (patch) | |
tree | c1ebf149f43fa653a4ef1c3f33df04557094e834 /js/vendor/es6-shim/es6-sham.js | |
parent | 2e54780c1496bfa39cd035b9ac40ed851d2198f1 (diff) |
update deps
Diffstat (limited to 'js/vendor/es6-shim/es6-sham.js')
-rw-r--r-- | js/vendor/es6-shim/es6-sham.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/js/vendor/es6-shim/es6-sham.js b/js/vendor/es6-shim/es6-sham.js index 105f09d16..570deb3f0 100644 --- a/js/vendor/es6-shim/es6-sham.js +++ b/js/vendor/es6-shim/es6-sham.js @@ -48,8 +48,16 @@ /*jshint proto: true */ // @author Andrea Giammarchi - @WebReflection - // define into target descriptors from source + + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var create = Object.create; + var defineProperty = Object.defineProperty; + var getPrototypeOf = Object.getPrototypeOf; + var objProto = Object.prototype; + var copyDescriptors = function (target, source) { + // define into target descriptors from source getOwnPropertyNames(source).forEach(function (key) { defineProperty( target, @@ -63,17 +71,11 @@ var createAndCopy = function (origin, proto) { return copyDescriptors(create(proto), origin); }; - var create = Object.create; - var defineProperty = Object.defineProperty; - var getPrototypeOf = Object.getPrototypeOf; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var proto = Object.prototype; var set, setPrototypeOf; try { // this might fail for various reasons // ignore if Chrome cought it at runtime - set = getOwnPropertyDescriptor(proto, '__proto__').set; + set = getOwnPropertyDescriptor(objProto, '__proto__').set; set.call({}, null); // setter not poisoned, it can promote // Firefox, Chrome @@ -90,7 +92,7 @@ setPrototypeOf = createAndCopy; } else { // verify if null objects are buggy - set.__proto__ = proto; + set.__proto__ = objProto; // if null objects are buggy // nodejs 0.8 to 0.10 if (set instanceof Object) { |