Skip to content

Commit

Permalink
Fix in default params
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Apr 19, 2021
1 parent f31830a commit 6f7cfa8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Expand Up @@ -61,6 +61,12 @@ export default function pluginPrivateIn({ types: t, template }) {
return true;
});

if (outerClass.parentPath.scope.path.isPattern()) {
outerClass.replaceWith(template.ast`(() => ${outerClass.node})()`);
// The injected class will be queued and eventually transformed when visited
return;
}

if (isStatic) {
if (!outerClass.node.id) {
outerClass.set("id", path.scope.generateUidIdentifier("class"));
Expand Down
@@ -0,0 +1,4 @@
(x = class {
#foo;
test(other) { return #foo in other }
}) => {}
@@ -0,0 +1,12 @@
(x = (() => {
var _brandCheck;

return _brandCheck = new WeakSet(), class {
#foo = void _brandCheck.add(this);

test(other) {
return _brandCheck.has(other);
}

};
})()) => {};

0 comments on commit 6f7cfa8

Please sign in to comment.