Skip to content

Commit

Permalink
Add /*@__PURE__*/ comment annotation to class IIFE
Browse files Browse the repository at this point in the history
  • Loading branch information
bisubus authored and adrianheine committed Oct 13, 2018
1 parent 24b1fab commit 8e87c35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/program/types/ClassDeclaration.js
Expand Up @@ -42,13 +42,13 @@ export default class ClassDeclaration extends Node {
if (this.superClass) {
if (this.superClass.end === this.body.start) {
code.remove(c, this.superClass.start);
code.appendLeft(c, ` = (function (${superName}) {\n${i1}`);
code.appendLeft(c, ` = /*@__PURE__*/(function (${superName}) {\n${i1}`);
} else {
code.overwrite(c, this.superClass.start, ' = ');
code.overwrite(
this.superClass.end,
this.body.start,
`(function (${superName}) {\n${i1}`
`/*@__PURE__*/(function (${superName}) {\n${i1}`
);
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/program/types/ClassExpression.js
Expand Up @@ -28,9 +28,9 @@ export default class ClassExpression extends Node {
if (this.superClass) {
code.remove(this.start, this.superClass.start);
code.remove(this.superClass.end, this.body.start);
code.appendLeft(this.start, `(function (${superName}) {\n${i1}`);
code.appendLeft(this.start, `/*@__PURE__*/(function (${superName}) {\n${i1}`);
} else {
code.overwrite(this.start, this.body.start, `(function () {\n${i1}`);
code.overwrite(this.start, this.body.start, `/*@__PURE__*/(function () {\n${i1}`);
}

this.body.transpile(code, transforms, true, superName);
Expand Down

0 comments on commit 8e87c35

Please sign in to comment.