Closed
Bug 1511401
Opened 7 years ago
Closed 7 years ago
Make some improvements to our reporting of insufficient arguments
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla66
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Keywords: dev-doc-complete)
Attachments
(4 files)
|
12.53 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
|
6.85 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
|
3.08 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
|
7.44 KB,
patch
|
qdot
:
review+
nbp
:
review+
|
Details | Diff | Splinter Review |
Our current error for not enough arguments for JS stuff looks like this:
TypeError: FUNC requires more than N arguments
and for DOM stuff:
TypeError: Not enough arguments to FUNC.
I haven't found a way to trigger the "JS stuff" case in Chrome so far, but their DOM case is:
TypeError: Failed to execute FUNC on OBJTYPE: N arguments required, but only M present.
I'd like to do two things: add reporting of how many args were actually passed to our "JS stuff" and make the DOM use the "JS stuff" mechanism to get the nicer reporting.
Updated•7 years ago
|
Priority: -- → P3
| Assignee | ||
Comment 1•7 years ago
|
||
Looks like these uses might predate requireAtLeast existing.
Attachment #9029104 -
Flags: review?(nicolas.b.pierron)
| Assignee | ||
Comment 2•7 years ago
|
||
Attachment #9029105 -
Flags: review?(nicolas.b.pierron)
| Assignee | ||
Comment 3•7 years ago
|
||
We don't want to pay the cost of a function call here in DOM bindings.
Attachment #9029106 -
Flags: review?(nicolas.b.pierron)
| Assignee | ||
Comment 4•7 years ago
|
||
Attachment #9029107 -
Flags: review?(nicolas.b.pierron)
Attachment #9029107 -
Flags: review?(kyle)
Comment 5•7 years ago
|
||
Comment on attachment 9029104 [details] [diff] [review]
part 1. Use requireAtLeast more in the JS engine
Review of attachment 9029104 [details] [diff] [review]:
-----------------------------------------------------------------
I had doubts about converting the non-zero "if (!=)" cases, but they all appears in js.cpp which does not matter spec-wise.
Attachment #9029104 -
Flags: review?(nicolas.b.pierron) → review+
Updated•7 years ago
|
Attachment #9029105 -
Flags: review?(nicolas.b.pierron) → review+
Updated•7 years ago
|
Attachment #9029106 -
Flags: review?(nicolas.b.pierron) → review+
Updated•7 years ago
|
Attachment #9029107 -
Flags: review?(nicolas.b.pierron) → review+
Comment 6•7 years ago
|
||
Comment on attachment 9029107 [details] [diff] [review]
part 4. Use CallArgs::requireAtLeast in the DOM
Review of attachment 9029107 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry this got stuck in my queue.
Attachment #9029107 -
Flags: review?(kyle) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e37a2cdffa1a
part 1. Use requireAtLeast more in the JS engine. r=nbp
https://hg.mozilla.org/integration/mozilla-inbound/rev/e381de28cdca
part 2. Have JSMGS_MORE_ARGS_NEEDED say how many args it actually got. r=nbp
https://hg.mozilla.org/integration/mozilla-inbound/rev/696e7b4f7535
part 3. Inline the fast (no error) path of requireAtLeast. r=nbp
https://hg.mozilla.org/integration/mozilla-inbound/rev/39b04fe4eae8
part 4. Use CallArgs::requireAtLeast in the DOM. r=nbp,qdot
Comment 8•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e37a2cdffa1a
https://hg.mozilla.org/mozilla-central/rev/e381de28cdca
https://hg.mozilla.org/mozilla-central/rev/696e7b4f7535
https://hg.mozilla.org/mozilla-central/rev/39b04fe4eae8
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Updated•7 years ago
|
Keywords: dev-doc-needed
Updated•7 years ago
|
Comment 9•7 years ago
•
|
||
Looks like Boris already updated the relevant MDN error page. Cheers!
I haven't added a note to the Fx66 rel notes, as I don't think it's really worth it for error message changes.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•