Bug 243645

Summary: Wrong error location with 'switch(value/'
Product: WebKit Reporter: 845043157
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: PC   
OS: Linux   

Description 845043157 2022-08-07 20:04:18 PDT
run the program:
switch(value/{
   case 1:
   print(1);
}

Actual results:
SyntaxError:Unexpected number '1'.Exceptd a ':' following the property name 'case'.

Expected results:
Excepted ')' to end a subject of a 'switch'

The error message told me 'case 1' is wrong while the truth is that I mistakenly entered ‘switch(value)’ as ‘switch(value/’.

It makes it difficult for me to correct this error.I think the error location should in 'switch(value/' rather than 'case 1:' and it should tell me excepted ')' rather than excepted a ':'.
Comment 1 Radar WebKit Bug Importer 2022-08-14 20:05:16 PDT
<rdar://problem/98651685>