Closed
Bug 785057
Opened 12 years ago
Closed 12 years ago
Assertion failure: !cx->isExceptionPending() because nsHTMLMediaElement::BuildObjectFromTags doesn't handle failure
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: Ms2ger, Assigned: rillian)
References
()
Details
Attachments
(1 file)
2.49 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
When a JSAPI function throws an exception, you need to stop using that context... See $URL.
Comment 1•12 years ago
|
||
In particular, this part is buggy: 1445 if (!JS_SetProperty(args->cx, args->tags, aKey.Data(), &value)) { 1446 NS_WARNING("Failed to set metadata property"); 1447 } That case needs to stop the iteration instead. Not only that, but it needs to ensure that an error rv is returned from MozGetMetadata. Alternately, if failure here should not throw to JS, it should explicitly clear the exception on cx. That said, it's a bit odd that this stuff is being affected by Object.prototype at all. Shouldn't this code be using JS_DefineProperty instead of JS_SetProperty? If it did that, we'd definitely want JS_DefineProperty failure to throw.
Blocks: 763010
Assignee | ||
Comment 2•12 years ago
|
||
Thanks for the pointer. I used JS_SetProperty because I didn't need the finer control JS_DefineProperty offers. To quote the JSAPI Reference, '"Define" is a lower-level version of "set" that provides access to extra settings and does not call setters.' That sounded like what I wanted. I'll change the code to return an error from MozGetMetadata.
Comment 3•12 years ago
|
||
Well, the question is whether you want to call setters off Object.prototype or not... Seems a bit weird to, honestly.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → giles
Assignee | ||
Comment 4•12 years ago
|
||
My initial reaction here was 'dynamic language is dynamic' but I've been convinced calling DefineProperty is less surprising here. The attached patch should address both issues. Thanks to Boris and Graydon for the explanations.
Attachment #660944 -
Flags: review?(bzbarsky)
Comment 5•12 years ago
|
||
Comment on attachment 660944 [details] [diff] [review] proposed fix r=me
Attachment #660944 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 6•12 years ago
|
||
Thanks! Pushed to try as https://tbpl.mozilla.org/?tree=Try&rev=0a57eabc8f65
Assignee | ||
Comment 8•12 years ago
|
||
No testsuite to verify the exception is fixed; the URL link is sufficient for that. Positive functionality of the code is verified by existing tests.
Comment 9•12 years ago
|
||
(In reply to Ralph Giles (:rillian) from comment #6) > Pushed to try as https://tbpl.mozilla.org/?tree=Try&rev=0a57eabc8f65 Green on Try. https://hg.mozilla.org/integration/mozilla-inbound/rev/7689bfe3675d
Flags: in-testsuite+
Keywords: checkin-needed
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7689bfe3675d
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Reporter | ||
Updated•12 years ago
|
Flags: in-testsuite+ → in-testsuite?
Assignee | ||
Comment 11•12 years ago
|
||
Ms2ger: can you be more specific about what you're after here?
Reporter | ||
Comment 12•12 years ago
|
||
The usual: a test that failed before the code change, and that passes now.
Reporter | ||
Comment 13•12 years ago
|
||
Bug 793315 shows why testing this code would have been useful.
Assignee | ||
Comment 14•12 years ago
|
||
Ok, thanks. Given all the complaints about cycle times I don't feel it's worth writing a test for the getter override. The script in the URL link is sufficient for qa to verify the bug is resolved.
Flags: in-testsuite? → in-testsuite-
Reporter | ||
Comment 15•12 years ago
|
||
This isn't about QA verifying anything, but about automated regression testing. Not sure what your comment about cycle times is about.
Flags: in-testsuite- → in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•