-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform
, babel.parse
)
Input code
> require('@babel/parser').parse('module {/* comment */}', {plugins: ['moduleBlocks']}).program.body[0].expression.body
Node {
type: 'Program',
start: 21, // <---------------------
end: 8, // <---------------------
loc: SourceLocation {
start: Position { line: 1, column: 21, index: 21 },
end: Position { line: 1, column: 8, index: 8 },
filename: undefined,
identifierName: undefined
},
sourceType: 'module',
interpreter: null,
body: [],
directives: [],
trailingComments: [
{
type: 'CommentBlock',
value: ' comment ',
start: 8,
end: 21,
loc: [SourceLocation]
}
]
}
Configuration file name
No response
Configuration
N/A
Current and expected behavior
Range should be 8 ~ 21
Environment
N/A
Possible solution
No response
Additional context
Metadata
Metadata
Assignees
Labels
i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser