Closed
Bug 593228
Opened 14 years ago
Closed 1 year ago
Add argument for strict warnings output to Reflect API
Categories
(Core :: JavaScript Engine, enhancement)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: WeirdAl, Unassigned)
References
Details
One nice feature of Komodo Edit is it will highlight JavaScript strict warnings for you. The Reflect API throws exceptions for syntax errors. I wonder if we can alter the API to include an optional out array parameter for strict warnings.
Comment 1•14 years ago
|
||
This sounds plausibly do-able. I'll dig into jsparse.
At this point it seems there are enough optional arguments (see also 569487) that maybe the API should take an object argument with the optional arguments encoded as properties, in the usual idiom.
Dave
Comment 2•14 years ago
|
||
> (see also 569487)
Ahem: bug 569487.
Dave
Comment 3•14 years ago
|
||
Now I'm confused. I don't see any mandated warnings in ES5-strict. Did you mean that strict-mode *errors* should be demoted to warnings and parsing should proceed? That might be a little harder, but I'd have to look.
Dave
Reporter | ||
Comment 4•14 years ago
|
||
(In reply to comment #3)
> Now I'm confused. I don't see any mandated warnings in ES5-strict. Did you mean
> that strict-mode *errors* should be demoted to warnings and parsing should
> proceed? That might be a little harder, but I'd have to look.
>
> Dave
No, I didn't mean that. But certain things trigger strict warnings:
function foo() {
if (bar) {
var response = true
} else {
var response = false
}
}
Reporter | ||
Comment 5•14 years ago
|
||
I was starting to think along the lines of a config param, with several options:
* Ignore strict warnings (default)
* Treat strict warnings as errors (throw whenever you encounter either of them)
* Throw on errors first, and if none, throw for the first strict warnings (prioritize errors over warnings)
* Return strict warnings as a JS array, if any are present (throw for exceptions, but track and report strict warnings separately)
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Updated•2 years ago
|
Severity: normal → S3
Updated•1 year ago
|
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•