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.
106 lines
1.8 KiB
Plaintext
106 lines
1.8 KiB
Plaintext
exports[`test class.js 1`] = `
|
|
"class A {
|
|
method() {
|
|
var x = 1;
|
|
while(typeof x == \"number\" || typeof x == \"string\") {
|
|
x = x + 1;
|
|
if (true) x = \"\";
|
|
}
|
|
var z:number = x;
|
|
}
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
class A {
|
|
method() {
|
|
var x = 1;
|
|
while (typeof x == \"number\" || typeof x == \"string\") {
|
|
x = x + 1;
|
|
if (true) x = \"\";
|
|
}
|
|
var z: number = x;
|
|
}
|
|
}
|
|
"
|
|
`;
|
|
|
|
exports[`test class.js 2`] = `
|
|
"class A {
|
|
method() {
|
|
var x = 1;
|
|
while(typeof x == \"number\" || typeof x == \"string\") {
|
|
x = x + 1;
|
|
if (true) x = \"\";
|
|
}
|
|
var z:number = x;
|
|
}
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
class A {
|
|
method() {
|
|
var x = 1;
|
|
while (typeof x == \"number\" || typeof x == \"string\") {
|
|
x = x + 1;
|
|
if (true) x = \"\";
|
|
}
|
|
var z: number = x;
|
|
}
|
|
}
|
|
"
|
|
`;
|
|
|
|
exports[`test nested-functions.spec.js 1`] = `
|
|
"const c = () => {};
|
|
|
|
function a() {
|
|
return function b() {
|
|
return () => {
|
|
return function() {
|
|
return c;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
const c = () => {
|
|
};
|
|
|
|
function a() {
|
|
return function b() {
|
|
return () => {
|
|
return function() {
|
|
return c;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
"
|
|
`;
|
|
|
|
exports[`test nested-functions.spec.js 2`] = `
|
|
"const c = () => {};
|
|
|
|
function a() {
|
|
return function b() {
|
|
return () => {
|
|
return function() {
|
|
return c;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
const c = () => {
|
|
};
|
|
|
|
function a() {
|
|
return function b() {
|
|
return () => {
|
|
return function() {
|
|
return c;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
"
|
|
`;
|