Closed
Bug 1154532
Opened 9 years ago
Closed 9 years ago
Add ThrowRangeError and ThrowTypeError self-hosting intrinsics
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: Waldo, Assigned: Waldo)
References
Details
Attachments
(1 file)
11.28 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
My %TypedArray%.prototype.set patch had a bug in it where I used ThrowError with an error message for an Error, when the spec required a RangeError be thrown. This was totally non-obvious without going out of my way to consult js.msg. Add self-hosting intrinsics like ThrowTypeError, with the exact same behavior as ThrowError now but asserting the error number's type is the expected one, to make clear at call sites what's happening, with assertions to verify it.
Assignee | ||
Comment 1•9 years ago
|
||
I added the intrinsics, and I added a smattering of uses to demonstrate the intrinsics work. But there's still a lot of work remaining to convert all ThrowError uses to a more-specific thing. Interestingly, the spec appears to have *no* cases where Error is thrown. And our self-hosted code appears not to have any places where ReferenceError, SyntaxError, or URIError are thrown. So no adding corresponding intrinsics yet.
Attachment #8592549 -
Flags: review?(till)
Comment 2•9 years ago
|
||
Comment on attachment 8592549 [details] [diff] [review] Patch Review of attachment 8592549 [details] [diff] [review]: ----------------------------------------------------------------- Particularly nice. ::: js/src/vm/SelfHosting.cpp @@ +154,5 @@ > JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS); > } > > +static void > +ThrowParticularError(JSContext* cx, JSExnType type, const CallArgs& args) "ThrowErrorWithType", perhaps? "Particular" doesn't seem particularly descriptive in this particular use.
Attachment #8592549 -
Flags: review?(till) → review+
Comment 4•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/76326ec30cd6
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•