-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
Bug Report
If there is a newline between declare type
and T = null;
, then as of v4.4.4 the parser behaves as if there was a semicolon between type
and T
(good) but also a semicolon between declare
and type
(bug).
declare /*ASI*/ type /*ASI*/
T = null;
I think it's a bug that a semicolon was implicitly inserted between declare
and type
without any newline in the source code. ASI normally interjects only if a newline is present (or in other special cases which I don't think apply here).
In version v4.3.5, the parser behaved as if there was only a semicolon between type
and T
(where there's a newline).
🔎 Search Terms
declare type asi
🕗 Version & Regression Information
- This changed between versions v4.3.5 and v4.4.4
⏯ Playground Link
Playground link with relevant code
💻 Code
var declare, type, T;
declare type
T = null;
🙁 Actual behavior
No diagnostic.
🙂 Expected behavior
Diagnostic: "';' expected." referring to after the declare
token on line 3.
suica
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.