Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
5 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; | ||
var _brand_check_y = new WeakSet(), _tmp; | ||
var x = function x() { | ||
"use strict"; | ||
_class_call_check(this, x); | ||
}; | ||
var _y = { | ||
writable: true, | ||
value: (_tmp = _brand_check_y.has(x), _brand_check_y.add(x), _tmp) | ||
value: x === x | ||
}; |
5 changes: 2 additions & 3 deletions
5
crates/swc/tests/tsc-references/privateNameInInExpressionUnused.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
//// [privateNameInInExpressionUnused.ts] | ||
var _brand_check_brand = new WeakSet(); | ||
class Foo { | ||
#unused; | ||
#brand = void _brand_check_brand.add(this); | ||
#brand; | ||
isFoo(v) { | ||
// This should count as using/reading '#brand' | ||
return _brand_check_brand.has(v); | ||
return #brand in v; | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
crates/swc/tests/tsc-references/privateNameInInExpressionUnused.2.minified.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
//// [privateNameInInExpressionUnused.ts] | ||
new WeakSet(); |
5 changes: 2 additions & 3 deletions
5
crates/swc_ecma_parser/tests/test262-error-references/fail/c3731145e0e65d1d.js.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
|
||
x Unexpected token `#`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` | ||
| for template literal, (, or an identifier | ||
x Expected ident | ||
,-[$DIR/tests/test262-parser/fail/c3731145e0e65d1d.js:1:1] | ||
1 | #= | ||
: ^ | ||
: ^ | ||
`---- |