I find it weird to put `{}` together. So I figured I would change it to have an empty line and ask for feedback :)

Beware: most of the test cases are not representative of real code, you almost never define blocks with no content in practice.
131 lines
1.9 KiB
Plaintext
131 lines
1.9 KiB
Plaintext
exports[`test Bar.js 1`] = `
|
|
"
|
|
/* @providesModule Bar */
|
|
|
|
var Qux = require(\'Qux\');
|
|
|
|
class Bar {
|
|
y:number;
|
|
self:Bar;
|
|
constructor(y:number) {
|
|
this.y = y;
|
|
this.self = this;
|
|
}
|
|
|
|
bar(z:string,u:string):string {
|
|
new Qux().w = \"?\";
|
|
return z;
|
|
}
|
|
}
|
|
|
|
module.exports = Bar;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
/* @providesModule Bar */
|
|
|
|
var Qux = require(\"Qux\");
|
|
|
|
class Bar {
|
|
y: number;
|
|
self: Bar;
|
|
constructor(y: number) {
|
|
this.y = y;
|
|
this.self = this;
|
|
}
|
|
|
|
bar(z: string, u: string): string {
|
|
new Qux().w = \"?\";
|
|
return z;
|
|
}
|
|
}
|
|
|
|
module.exports = Bar;
|
|
"
|
|
`;
|
|
|
|
exports[`test Foo.js 1`] = `
|
|
"
|
|
/* @providesModule Foo */
|
|
|
|
var Bar = require(\'Bar\');
|
|
var Qux = require(\'Qux\');
|
|
|
|
class Foo extends Qux {
|
|
x:string;
|
|
constructor(x:string) {
|
|
this.x = x;
|
|
}
|
|
|
|
foo(y:string,z):number {
|
|
this.x = y;
|
|
var u = new Foo(\"...\").qux();
|
|
var v = new Bar(y);
|
|
v.self = v;
|
|
return v.bar(z,u);
|
|
}
|
|
|
|
fooqux(x:string) {
|
|
this.x;
|
|
}
|
|
}
|
|
|
|
module.exports = Foo;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
/* @providesModule Foo */
|
|
|
|
var Bar = require(\"Bar\");
|
|
var Qux = require(\"Qux\");
|
|
|
|
class Foo extends Qux {
|
|
x: string;
|
|
constructor(x: string) {
|
|
this.x = x;
|
|
}
|
|
|
|
foo(y: string, z): number {
|
|
this.x = y;
|
|
var u = new Foo(\"...\").qux();
|
|
var v = new Bar(y);
|
|
v.self = v;
|
|
return v.bar(z, u);
|
|
}
|
|
|
|
fooqux(x: string) {
|
|
this.x;
|
|
}
|
|
}
|
|
|
|
module.exports = Foo;
|
|
"
|
|
`;
|
|
|
|
exports[`test Qux.js 1`] = `
|
|
"
|
|
/* @providesModule Qux */
|
|
|
|
class Qux {
|
|
w:number;
|
|
|
|
qux() { return this.w; }
|
|
|
|
fooqux(x:number) { }
|
|
}
|
|
|
|
module.exports = Qux;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
/* @providesModule Qux */
|
|
|
|
class Qux {
|
|
w: number;
|
|
|
|
qux() {
|
|
return this.w;
|
|
}
|
|
|
|
fooqux(x: number) {
|
|
}
|
|
}
|
|
|
|
module.exports = Qux;
|
|
"
|
|
`;
|