Merge pull request #1317 from jeffmo/copy_static_props_on_foreign_export_objs

Copy statics from foreign exports objects when doing an ES6 import
This commit is contained in:
Sebastian McKenzie
2015-04-21 22:44:52 +01:00
8 changed files with 27 additions and 14 deletions

View File

@@ -1,3 +1,16 @@
(function (obj) {
return obj && obj.__esModule ? obj : { default: obj };
if (obj && obj.__esModule) {
return obj;
} else {
var hop = Object.prototype.hasOwnProperty;
var es_obj = { "default": obj };
if (typeof obj === "object" && obj !== null) {
for (var key in obj) {
if (key !== "default" && hop.call(obj, key)) {
es_obj[key] = obj[key];
}
}
}
return es_obj;
}
})