Open Bug 593228 Opened 14 years ago Updated 2 years ago

Add argument for strict warnings output to Reflect API

Categories

(Core :: JavaScript Engine, enhancement)

x86
All
enhancement

Tracking

()

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.
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
> (see also 569487) Ahem: bug 569487. Dave
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
(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 } }
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)
Depends on: 594060
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.