-
Notifications
You must be signed in to change notification settings - Fork 65
Question about a generated closures. #219
Copy link
Copy link
Closed
Labels
Description
We at the three.js team try move our code base to ES6 classes and want to use Bublé to generate ES2015 code. When inspecting the output, we noticed that Bublé produces a closure around class definitions iff the class is inherited from another one. Consider this (stripped-down) code:
class BoxGeometry extends Geometry {
constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {
super();
this.type = 'BoxGeometry';
}
}Bublé produces:
var BoxGeometry = /*@__PURE__*/(function (Geometry) {
function BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) {
Geometry.call(this);
this.type = 'BoxGeometry';
}
if ( Geometry ) BoxGeometry.__proto__ = Geometry;
BoxGeometry.prototype = Object.create( Geometry && Geometry.prototype );
BoxGeometry.prototype.constructor = BoxGeometry;
return BoxGeometry;
}(Geometry));Is there a way to avoid the closure around BoxGeometry (see mrdoob/three.js#17276 (comment))?
Reactions are currently unavailable