Skip to content

Commit

Permalink
Use separate var statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 13, 2014
1 parent 7d0f7d0 commit 77258e4
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions es6-sham.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,29 @@
if (!Object.setPrototypeOf) (function () {
/*jshint proto: true */
// @author Andrea Giammarchi - @WebReflection
var
// define into target descriptors from source
copyDescriptors = function (target, source) {
getOwnPropertyNames(source).forEach(function (key) {
defineProperty(
target,
key,
getOwnPropertyDescriptor(source, key)
);
});
return target;
},
// used as fallback when no promotion is possible
createAndCopy = function (origin, proto) {
return copyDescriptors(create(proto), origin);
},
create = Object.create,
defineProperty = Object.defineProperty,
getPrototypeOf = Object.getPrototypeOf,
getOwnPropertyNames = Object.getOwnPropertyNames,
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
proto = Object.prototype,
set, setPrototypeOf
;
var copyDescriptors = function (target, source) {
getOwnPropertyNames(source).forEach(function (key) {
defineProperty(
target,
key,
getOwnPropertyDescriptor(source, key)
);
});
return target;
};
// used as fallback when no promotion is possible
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
Expand Down

0 comments on commit 77258e4

Please sign in to comment.