2017-03-09 04:06:18 +03:00
|
|
|
function jsx() {
|
2017-02-14 05:35:42 +03:00
|
|
|
return (
|
|
|
|
// Comment
|
|
|
|
<div />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-03-09 04:06:18 +03:00
|
|
|
function unary() {
|
2017-02-14 05:35:42 +03:00
|
|
|
return (
|
|
|
|
// Comment
|
|
|
|
!!x
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-03-09 04:06:18 +03:00
|
|
|
function numericLiteralNoParen() {
|
2017-02-14 05:35:42 +03:00
|
|
|
return 1337; // Comment
|
|
|
|
}
|
2017-03-09 04:06:18 +03:00
|
|
|
|
|
|
|
function logical() {
|
|
|
|
return (
|
|
|
|
// Reason for 42
|
|
|
|
42
|
|
|
|
) && 84
|
|
|
|
}
|
|
|
|
|
|
|
|
function binary() {
|
|
|
|
return (
|
|
|
|
// Reason for 42
|
|
|
|
42
|
|
|
|
) * 84
|
|
|
|
}
|
|
|
|
|
|
|
|
function binaryInBinaryLeft() {
|
|
|
|
return (
|
|
|
|
// Reason for 42
|
|
|
|
42
|
|
|
|
) * 84 + 2
|
|
|
|
}
|
|
|
|
|
|
|
|
function binaryInBinaryRight() {
|
|
|
|
return (
|
|
|
|
// Reason for 42
|
|
|
|
42
|
|
|
|
) + 84 * 2
|
|
|
|
}
|
|
|
|
|
|
|
|
function conditional() {
|
|
|
|
return (
|
|
|
|
// Reason for 42
|
|
|
|
42
|
|
|
|
) ? 1 : 2
|
|
|
|
}
|
|
|
|
|
|
|
|
function binaryInConditional() {
|
|
|
|
return (
|
|
|
|
// Reason for 42
|
|
|
|
42
|
|
|
|
) * 3 ? 1 : 2
|
|
|
|
}
|
|
|
|
|
|
|
|
function call() {
|
|
|
|
return (
|
|
|
|
// Reason for a
|
|
|
|
a
|
|
|
|
)()
|
|
|
|
}
|
|
|
|
|
|
|
|
function memberInside() {
|
|
|
|
return (
|
|
|
|
// Reason for a.b
|
|
|
|
a.b
|
|
|
|
).c
|
|
|
|
}
|
|
|
|
|
|
|
|
function memberOutside() {
|
|
|
|
return (
|
|
|
|
// Reason for a
|
|
|
|
a
|
|
|
|
).b.c
|
|
|
|
}
|
|
|
|
|
|
|
|
function memberInAndOutWithCalls() {
|
|
|
|
return (
|
|
|
|
// Reason for a
|
|
|
|
a.b()
|
|
|
|
).c.d()
|
|
|
|
}
|
|
|
|
|
|
|
|
function excessiveEverything() {
|
|
|
|
return (
|
|
|
|
// Reason for stuff
|
|
|
|
a.b() * 3 + 4 ? (a`hi`, 1) ? 1 : 1 : 1
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function sequenceExpression() {
|
|
|
|
return (
|
|
|
|
// Reason for a
|
|
|
|
a
|
|
|
|
), b
|
|
|
|
}
|
|
|
|
|
2017-04-05 23:41:35 +03:00
|
|
|
function sequenceExpressionInside() {
|
|
|
|
return ( // Reason for a
|
|
|
|
a, b
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-03-09 04:06:18 +03:00
|
|
|
function taggedTemplate() {
|
|
|
|
return (
|
|
|
|
// Reason for a
|
|
|
|
a
|
|
|
|
)`b`
|
|
|
|
}
|
|
|
|
|
|
|
|
function inlineComment() {
|
|
|
|
return (
|
|
|
|
/* hi */ 42
|
|
|
|
) || 42
|
|
|
|
}
|