Open
Bug 624766
Opened 14 years ago
Updated 1 year ago
poor error fingering for strict error about octal in unrecognized directive
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: brendan, Unassigned)
References
(Blocks 1 open bug)
Details
js> function f(){ "\145"; "use strict"; }
typein:1: SyntaxError: octal literals and octal escape sequences are deprecated:
typein:1: function f(){ "\145"; "use strict"; }
typein:1: ..................................^
js> function f(){
"\145" // octal escape
"use strict"
}
typein:5: SyntaxError: octal literals and octal escape sequences are deprecated:
typein:5: }
typein:5: ..^
js>
Burning directives (recognized or not) into the AST could help, but then you need to suppress code generation while avoiding useless expression warnings (see bug 624199, where the current solution does not build AST for directives).
A minor polish bug, but these count and they can be fun when release pressure is (finally) off.
/be
Comment 1•14 years ago
|
||
We do retain the directive prologue in the parse tree, for functions at least. All that's missing here is some way for the scanner to indicate whether each specific token used the octal escapes.
Comment 2•14 years ago
|
||
... and a corresponding way to retain that in the parse nodes. Steal a bit!
Comment 3•14 years ago
|
||
If I got more firepower behind me and convinced ECMA to make string literals containing escapes not directive prologue members, maybe we could avoid having to do any work to fix this. ;-)
Comment 4•14 years ago
|
||
(In reply to comment #3)
> If I got more firepower behind me and convinced ECMA to make string literals
> containing escapes not directive prologue members, maybe we could avoid having
> to do any work to fix this. ;-)
This is the better solution, yes.
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Updated•2 years ago
|
Severity: normal → S3
Updated•1 year ago
|
Type: defect → enhancement
Priority: -- → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•