| Summary: | 'a\n' is considered as a variable | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | 845043157 |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | karlcow, saam, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 15 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
845043157
2022-08-16 20:22:34 PDT
Safari, Firefox and Chrome return the same error message. but indeed Firefox and Chrome normalizes the output to avoid the return. Full Safari output ``` TypeError: a is not a function. (In 'a ()', 'a ' is 1) ``` I wonder if it would be better to actually shows the output as: ``` TypeError: a\n is not a function. (In 'a\n()', 'a\n' is 1) ``` '\n' is illegal in variable name and function name.'var a\nb=1' will throw a SyntaxError.So print 'TypeError: a\n is not a function.' may be not a good idea.It regard 'a\n' as a variable name. But '\n' is meaningless in the end of variable name and function name and will be ignored. If running the following program: var a =1; print(a); print(a ); a=2; print(a); print(a ); It output: 1 1 2 2 So during compilation,'\n' in the end of variable name and function name will be ignored.The '\n' of variable name 'a\n' will be ignored and 'a\n' is regarded as 'a'. I think 'TypeError:a is not a function' is better. Yes agreed. But how do we help the developer to discover the error. :) That's where I was coming from. All I know is that I can report the bug in this website.Isn't it the bug tracking system for JSC? |