Bug 243645 - Wrong error location with 'switch(value/'
Summary: Wrong error location with 'switch(value/'
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 15
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-08-07 20:04 PDT by 845043157
Modified: 2022-08-14 20:05 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>