2017-02-27 07:49:08 -08:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
2022-01-28 15:25:30 +08:00
|
|
|
exports[`call-arguments.js [acorn] format 1`] = `
|
|
|
|
|
"Unexpected token (3:3)
|
|
|
|
|
1 | // from https://github.com/babel/babel/pull/13122/
|
|
|
|
|
2 | expect(
|
|
|
|
|
> 3 | do {
|
|
|
|
|
| ^
|
|
|
|
|
4 | var bar = \\"foo\\";
|
|
|
|
|
5 | if (!bar) throw new Error(
|
|
|
|
|
6 | \\"unreachable\\""
|
|
|
|
|
`;
|
|
|
|
|
|
2021-04-12 10:22:44 +09:00
|
|
|
exports[`call-arguments.js [espree] format 1`] = `
|
|
|
|
|
"Unexpected token do (3:3)
|
|
|
|
|
1 | // from https://github.com/babel/babel/pull/13122/
|
|
|
|
|
2 | expect(
|
|
|
|
|
> 3 | do {
|
|
|
|
|
| ^
|
|
|
|
|
4 | var bar = \\"foo\\";
|
|
|
|
|
5 | if (!bar) throw new Error(
|
|
|
|
|
6 | \\"unreachable\\""
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`call-arguments.js [meriyah] format 1`] = `
|
2022-02-16 08:24:53 +08:00
|
|
|
"Unexpected token: 'do' (3:4)
|
2021-04-12 10:22:44 +09:00
|
|
|
1 | // from https://github.com/babel/babel/pull/13122/
|
|
|
|
|
2 | expect(
|
|
|
|
|
> 3 | do {
|
|
|
|
|
| ^
|
|
|
|
|
4 | var bar = \\"foo\\";
|
|
|
|
|
5 | if (!bar) throw new Error(
|
|
|
|
|
6 | \\"unreachable\\""
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`call-arguments.js format 1`] = `
|
|
|
|
|
====================================options=====================================
|
|
|
|
|
parsers: ["babel"]
|
|
|
|
|
printWidth: 80
|
|
|
|
|
| printWidth
|
|
|
|
|
=====================================input======================================
|
|
|
|
|
// from https://github.com/babel/babel/pull/13122/
|
|
|
|
|
expect(
|
|
|
|
|
do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
if (!bar) throw new Error(
|
|
|
|
|
"unreachable"
|
|
|
|
|
)
|
|
|
|
|
bar;
|
|
|
|
|
}
|
|
|
|
|
).toBe("foo");
|
|
|
|
|
expect(bar).toBe("foo");
|
|
|
|
|
|
|
|
|
|
var x = do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
if (!bar) throw new Error(
|
|
|
|
|
"unreachable"
|
|
|
|
|
)
|
|
|
|
|
bar;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
bar;
|
|
|
|
|
}
|
|
|
|
|
).toBe("foo");
|
|
|
|
|
expect(bar).toBe("foo");
|
|
|
|
|
|
|
|
|
|
var x = do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
bar;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
() => do {
|
|
|
|
|
() => {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
};
|
|
|
|
|
bar;
|
|
|
|
|
}
|
|
|
|
|
).toThrow(ReferenceError);
|
|
|
|
|
|
|
|
|
|
=====================================output=====================================
|
|
|
|
|
// from https://github.com/babel/babel/pull/13122/
|
|
|
|
|
expect(do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
if (!bar) throw new Error("unreachable");
|
|
|
|
|
bar;
|
|
|
|
|
}).toBe("foo");
|
|
|
|
|
expect(bar).toBe("foo");
|
|
|
|
|
|
|
|
|
|
var x = do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
if (!bar) throw new Error("unreachable");
|
|
|
|
|
bar;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
expect(do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
bar;
|
|
|
|
|
}).toBe("foo");
|
|
|
|
|
expect(bar).toBe("foo");
|
|
|
|
|
|
|
|
|
|
var x = do {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
bar;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
() => do {
|
|
|
|
|
() => {
|
|
|
|
|
var bar = "foo";
|
|
|
|
|
};
|
|
|
|
|
bar;
|
|
|
|
|
}
|
|
|
|
|
).toThrow(ReferenceError);
|
|
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-28 15:25:30 +08:00
|
|
|
exports[`do.js [acorn] format 1`] = `
|
|
|
|
|
"Unexpected token (3:5)
|
|
|
|
|
1 | const envSpecific = {
|
|
|
|
|
2 | domain:
|
|
|
|
|
> 3 | do {
|
|
|
|
|
| ^
|
|
|
|
|
4 | if(env === 'production') 'https://abc.mno.com/';
|
|
|
|
|
5 | else if(env === 'development') 'http://localhost:4000';
|
|
|
|
|
6 | }"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-06 15:27:04 +08:00
|
|
|
exports[`do.js [espree] format 1`] = `
|
|
|
|
|
"Unexpected token do (3:5)
|
|
|
|
|
1 | const envSpecific = {
|
|
|
|
|
2 | domain:
|
|
|
|
|
> 3 | do {
|
|
|
|
|
| ^
|
|
|
|
|
4 | if(env === 'production') 'https://abc.mno.com/';
|
|
|
|
|
5 | else if(env === 'development') 'http://localhost:4000';
|
|
|
|
|
6 | }"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`do.js [meriyah] format 1`] = `
|
2022-02-16 08:24:53 +08:00
|
|
|
"Unexpected token: 'do' (3:6)
|
2020-11-06 15:27:04 +08:00
|
|
|
1 | const envSpecific = {
|
|
|
|
|
2 | domain:
|
|
|
|
|
> 3 | do {
|
|
|
|
|
| ^
|
|
|
|
|
4 | if(env === 'production') 'https://abc.mno.com/';
|
|
|
|
|
5 | else if(env === 'development') 'http://localhost:4000';
|
|
|
|
|
6 | }"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-04-10 19:12:01 +08:00
|
|
|
exports[`do.js format 1`] = `
|
2018-11-25 16:21:14 +08:00
|
|
|
====================================options=====================================
|
2018-12-27 08:05:19 -05:00
|
|
|
parsers: ["babel"]
|
2018-11-25 16:21:14 +08:00
|
|
|
printWidth: 80
|
|
|
|
|
| printWidth
|
|
|
|
|
=====================================input======================================
|
2017-04-12 13:41:51 -07:00
|
|
|
const envSpecific = {
|
2017-02-27 07:49:08 -08:00
|
|
|
domain:
|
|
|
|
|
do {
|
|
|
|
|
if(env === 'production') 'https://abc.mno.com/';
|
|
|
|
|
else if(env === 'development') 'http://localhost:4000';
|
|
|
|
|
}
|
|
|
|
|
};
|
2018-05-15 11:41:17 -05:00
|
|
|
|
|
|
|
|
let x = do {
|
|
|
|
|
let tmp = f();
|
|
|
|
|
tmp * tmp + 1
|
|
|
|
|
};
|
|
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
let y = do {
|
2018-05-15 11:41:17 -05:00
|
|
|
if (foo()) { f() }
|
|
|
|
|
else if (bar()) { g() }
|
|
|
|
|
else { h() }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function foo() {
|
|
|
|
|
return (
|
|
|
|
|
<nav>
|
|
|
|
|
<Home />
|
|
|
|
|
{
|
|
|
|
|
do {
|
|
|
|
|
if (loggedIn) {
|
|
|
|
|
<LogoutButton />
|
|
|
|
|
} else {
|
|
|
|
|
<LoginButton />
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</nav>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(do {});
|
|
|
|
|
(do {} + 1);
|
|
|
|
|
(1 + do {});
|
|
|
|
|
() => do {};
|
|
|
|
|
|
|
|
|
|
(do {
|
|
|
|
|
switch(0) {
|
|
|
|
|
case 0: "foo";
|
|
|
|
|
case 1: break;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
() => do {
|
|
|
|
|
var obj = { foo: "bar", bar: "foo" };
|
|
|
|
|
for (var key in obj) {
|
|
|
|
|
obj[key];
|
|
|
|
|
}
|
|
|
|
|
};
|
2018-11-25 16:21:14 +08:00
|
|
|
|
|
|
|
|
=====================================output=====================================
|
2017-02-27 07:49:08 -08:00
|
|
|
const envSpecific = {
|
|
|
|
|
domain: do {
|
2017-06-06 17:24:13 +02:00
|
|
|
if (env === "production") "https://abc.mno.com/";
|
|
|
|
|
else if (env === "development") "http://localhost:4000";
|
2019-11-18 18:39:12 +08:00
|
|
|
},
|
2017-02-27 07:49:08 -08:00
|
|
|
};
|
2017-04-12 13:41:51 -07:00
|
|
|
|
2018-05-15 11:41:17 -05:00
|
|
|
let x = do {
|
|
|
|
|
let tmp = f();
|
|
|
|
|
tmp * tmp + 1;
|
|
|
|
|
};
|
|
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
let y = do {
|
2018-05-15 11:41:17 -05:00
|
|
|
if (foo()) {
|
|
|
|
|
f();
|
|
|
|
|
} else if (bar()) {
|
|
|
|
|
g();
|
|
|
|
|
} else {
|
|
|
|
|
h();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function foo() {
|
|
|
|
|
return (
|
|
|
|
|
<nav>
|
|
|
|
|
<Home />
|
|
|
|
|
{do {
|
|
|
|
|
if (loggedIn) {
|
|
|
|
|
<LogoutButton />;
|
|
|
|
|
} else {
|
|
|
|
|
<LoginButton />;
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
</nav>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(do {});
|
|
|
|
|
(do {} + 1);
|
|
|
|
|
1 + do {};
|
|
|
|
|
() => do {};
|
|
|
|
|
|
|
|
|
|
(do {
|
|
|
|
|
switch (0) {
|
|
|
|
|
case 0:
|
|
|
|
|
"foo";
|
|
|
|
|
case 1:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
() => do {
|
|
|
|
|
var obj = { foo: "bar", bar: "foo" };
|
|
|
|
|
for (var key in obj) {
|
|
|
|
|
obj[key];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2018-11-25 16:21:14 +08:00
|
|
|
================================================================================
|
2017-02-27 07:49:08 -08:00
|
|
|
`;
|