Closed
Bug 1215072
Opened 9 years ago
Closed 9 years ago
Assertion failure: !JS_IsExceptionPending(cx), at ./HTMLCanvasElementBinding.cpp:231
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(2 files, 1 obsolete file)
13.51 KB,
patch
|
Details | Diff | Splinter Review | |
13.65 KB,
patch
|
Details | Diff | Splinter Review |
Run the following in the web console (using a debug build): document.createElement("canvas").getContext("webgl", { get stencil() {throw "bah"; } }); or document.createElement("canvas").getContext("2d", { get alpha() {throw "bah"; } }); and you see Assertion failure: !JS_IsExceptionPending(cx), at ./HTMLCanvasElementBinding.cpp As far as I see, the patch for bug 645792 was wrong, since it made us return NS_OK, even if there was an error. In case the dictionary init fails, that should be propagated to the caller, since it effectively happens before the getContext call.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → bugs
Assignee | ||
Comment 1•9 years ago
|
||
Make sure we throw in case dictionary initialization fails. A bit messy patch, but the setup is such.
Attachment #8674968 -
Flags: review?(amarchesini)
Comment 2•9 years ago
|
||
Comment on attachment 8674968 [details] [diff] [review] patch Review of attachment 8674968 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/canvas/CanvasRenderingContext2D.cpp @@ +1605,5 @@ > return NS_OK; > } > > NS_IMETHODIMP > +CanvasRenderingContext2D::SetContextOptions(JSContext* aCx, Can we make this void SetContextOptions(..., ErrorResult& aRv) ? ::: dom/canvas/CanvasRenderingContextHelper.cpp @@ +172,5 @@ > > mCurrentContext = context.forget(); > mCurrentContextType = contextType; > > + nsresult rv = UpdateContext(aCx, aContextOptions, aRv); This would be: ErrorResult rv; UpdateContext(aCx, aContextOptions, rv); if (rv.Failed()) { return nullptr; } @@ +204,5 @@ > mCurrentContext = nullptr; > return rv; > } > > + rv = currentContext->SetContextOptions(aCx, aNewContextOptions, aRv); This really confuses me a lot. Why we use aRv somewhere, and rv somewhere else?
Attachment #8674968 -
Flags: review?(amarchesini) → review-
Comment 3•9 years ago
|
||
Comment on attachment 8674968 [details] [diff] [review] patch Review of attachment 8674968 [details] [diff] [review]: ----------------------------------------------------------------- I and smaug discussed this bug on IRC. We need a better name for aRv and a comment to explain why we have a double return error code.
Attachment #8674968 -
Flags: review- → review+
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #2) > > +CanvasRenderingContext2D::SetContextOptions(JSContext* aCx, > > Can we make this void SetContextOptions(..., ErrorResult& aRv) ? As I said on IRC, we really need two different rv values. But I guess aRv could be called aRvForDictionaryInit > This would be: > ErrorResult rv; > UpdateContext(aCx, aContextOptions, rv); > if (rv.Failed()) { > return nullptr; > } And that would regress bug 645792
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8674968 -
Attachment is obsolete: true
Comment 7•9 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/3f4d60ce3418 - b2g would rather not be involved in running that test, https://treeherder.mozilla.org/logviewer.html#?job_id=15792279&repo=mozilla-inbound
Assignee | ||
Comment 8•9 years ago
|
||
Ah, just a mistake in the test.
Assignee | ||
Comment 9•9 years ago
|
||
Comment 11•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b5e0aa4ec511
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•