Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(es/helpers): Fix loose mode #6691

Merged
merged 5 commits into from Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions crates/swc/tests/exec/issues-6xxx/6581/1/.swcrc
@@ -0,0 +1,19 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es2019",
"loose": true,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}
9 changes: 9 additions & 0 deletions crates/swc/tests/exec/issues-6xxx/6581/1/exec.ts
@@ -0,0 +1,9 @@
class Hoge {
#hoge: number
constructor() {
this.#hoge = 42
}
}

new Hoge()
new Hoge()
20 changes: 20 additions & 0 deletions crates/swc/tests/exec/issues-6xxx/6581/2/.swcrc
@@ -0,0 +1,20 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es2019",
"loose": true,
"minify": {
"compress": false,
"mangle": false
},
"externalHelpers": true
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}
9 changes: 9 additions & 0 deletions crates/swc/tests/exec/issues-6xxx/6581/2/exec.ts
@@ -0,0 +1,9 @@
class Hoge {
#hoge: number
constructor() {
this.#hoge = 42
}
}

new Hoge()
new Hoge()
Expand Up @@ -3,5 +3,5 @@ export default function _classPrivateFieldBase(receiver, privateKey) {
throw new TypeError("attempted to use private field on non-instance");
}

return receiver;
return receiver[privateKey];
}