Skip to content

Commit

Permalink
Do not warn for loose of class features in preset-env (#12898)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 25, 2021
1 parent b17231e commit 9a1b59f
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 2 deletions.
Expand Up @@ -29,6 +29,7 @@
},
"devDependencies": {
"@babel/core": "workspace:*",
"@babel/helper-plugin-test-runner": "workspace:*"
"@babel/helper-plugin-test-runner": "workspace:*",
"@babel/preset-env": "workspace:*"
}
}
Expand Up @@ -44,7 +44,7 @@ export function createClassFeaturePlugin({
const constantSuper = api.assumption("constantSuper");
const noDocumentAll = api.assumption("noDocumentAll");

if (loose) {
if (loose === true) {
const explicit = [];

if (setPublicClassFields !== undefined) {
Expand Down
@@ -0,0 +1,3 @@
class A {
foo;
}
@@ -0,0 +1,8 @@
{
"validateLogs": true,
"presets": [["env", { "shippedProposals": true }]],
"assumptions": {
"setPublicClassFields": true
},
"targets": "chrome 70"
}
@@ -0,0 +1,6 @@
class A {
constructor() {
this.foo = void 0;
}

}
@@ -0,0 +1 @@

@@ -0,0 +1,3 @@
class A {
foo;
}
@@ -0,0 +1,8 @@
{
"validateLogs": true,
"presets": [["env", { "loose": true, "shippedProposals": true }]],
"assumptions": {
"setPublicClassFields": true
},
"targets": "chrome 70"
}
@@ -0,0 +1,6 @@
class A {
constructor() {
this.foo = void 0;
}

}
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions yarn.lock
Expand Up @@ -429,6 +429,7 @@ __metadata:
"@babel/helper-plugin-test-runner": "workspace:*"
"@babel/helper-replace-supers": "workspace:^7.13.0"
"@babel/helper-split-export-declaration": "workspace:^7.12.13"
"@babel/preset-env": "workspace:*"
peerDependencies:
"@babel/core": ^7.0.0
languageName: unknown
Expand Down

0 comments on commit 9a1b59f

Please sign in to comment.