Closed zcappp closed 3 years ago
@zclc - I can't reproduce this (when using the comment plugin). This test passes:
test('should not throw', (assert) => {
testParser(`log(22)
// log(11)
`, {
type: 'CallExpression',
arguments: [
{
type: 'Literal',
value: 22,
raw: '22'
}
],
callee: {
type: 'Identifier',
name: 'log'
}}, assert);
});
@6utt3rfly yes, if comment out the second line in my second case:
log(22)
// log(11)
it works fine, as it is NOT at the head of first line. but if comment out the first line as the NG case:
// log(11)
log(22)
it errors out.
another note: the case is the COMPOUND expression, not in one line, as log(22) // log(11)
Thanks @zclc - I guess my unit test was not written correctly, which is why I couldn't see it! 🤦🏻♀️
:tada: This issue has been resolved in version @jsep-plugin/comment-v1.0.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
If I comment at the head of first line with the comment plugin registered:
jsep will throw error when parsing:
but it works fine if I swap the lines:
parsed as: