Skip to content

SyntaxErrors ignore startLine option #9015

@tolmasky

Description

@tolmasky

Bug Report

Current Behavior
If a SyntaxError is thrown from @babel/parse, startLine is ignored (it uses the "real" start line).

Input Code

https://runkit.com/tolmasky/babel-issue-9015---syntaxerrors-ignore-startline-option

const { parse } = require("@babel/parser");

parse("5+", { startLine: 10 });

Expected behavior/code
It should take into account startLine.

Environment

  • Babel version(s): 7.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions