mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
4d993c26b6
swc_ecma_transforms_base: - `hygiene`: Treat class methods and constructors as a scope.
24 lines
481 B
TypeScript
24 lines
481 B
TypeScript
const m2 = "test";
|
|
if (!m2) {
|
|
throw new Error('b');
|
|
}
|
|
class Comparator {
|
|
constructor(comp, optionsOrLoose = {
|
|
}){
|
|
}
|
|
parse(comp) {
|
|
const m = "another";
|
|
if (!m) {
|
|
throw new TypeError("Invalid comparator: " + comp);
|
|
}
|
|
const m1 = m[1];
|
|
console.log(m1);
|
|
if (!m[2]) {
|
|
console.log('other');
|
|
}
|
|
}
|
|
}
|
|
const x = new Comparator('boo');
|
|
x.parse('test');
|
|
export { Comparator as Comparator };
|