Closed
Bug 614753
Opened 15 years ago
Closed 15 years ago
reddit-panel example addon throws "Object.getPrototypeOf(event.constructor.prototype) is null"
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
1.0b1
People
(Reporter: myk, Assigned: irakli)
References
()
Details
Attachments
(2 files)
|
1.27 KB,
patch
|
myk
:
review+
|
Details | Diff | Splinter Review |
|
3.25 KB,
patch
|
myk
:
review+
|
Details | Diff | Splinter Review |
Running the reddit-panel example addon on both the Firefox tip and 4.0b7 throws an exception:
error: An exception occurred.
Traceback (most recent call last):
File "resource://anonid0-reddit-panel-jetpack-core-lib/timer.js", line 64, in notifyOnTimeout
this._callback.apply(null, this._params);
File "resource://anonid0-reddit-panel-jetpack-core-lib/content/worker.js", line 61, in emitter
emit.apply(scope, params);
File "resource://anonid0-reddit-panel-jetpack-core-lib/events.js", line 131, in _emit
'Error' == Object.getPrototypeOf(event.constructor.prototype).name
TypeError: Object.getPrototypeOf(event.constructor.prototype) is null
The exception does not occur when running the addon on Firefox 4.0b6, so it appears to be a regression between b6 and b7. Per bug 614613, comment 0, Irakli suspects it is compartments-related and similar to bug 608959, since the code in question is calling Object.getPrototypeOf on an object from another sandbox.
I haven't been able to reduce a testcase yet, but to reproduce the problem, enter the SDK's examples/reddit-panel/ directory and execute "cfx run".
| Reporter | ||
Comment 1•15 years ago
|
||
Irakli: you mentioned last week that you were trying to reduce a testcase for this. Have you made any progress?
Note that the fix for bug 615081 suppresses the exception in the content script that reveals this problem. That doesn't mean it isn't still a problem, only that it won't manifest in the reddit-panel example addon after that fix.
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → rFobic
| Assignee | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> Irakli: you mentioned last week that you were trying to reduce a testcase for
> this. Have you made any progress?
>
> Note that the fix for bug 615081 suppresses the exception in the content script
> that reveals this problem. That doesn't mean it isn't still a problem, only
> that it won't manifest in the reddit-panel example addon after that fix.
I did not manged to find out why does this bug occurs unfortunately and I really would like to find it out, but at the moment I would like to suggest a different fix, I actually thought of changing default behavior of `EventEmitter` from throwing on unhandled exception to a logging it, since all the consumers just log it anyway. Also I think that there is nothing that object derived from EventEmitter can do when one of the listeners throw. So here is a patch with a fix: https://github.com/mozilla/addon-sdk/pull/55
I also think that finding a reason why Object.getPrototypeOf(event.constructor.prototype) misbehaves should not be a beta blocker.
| Assignee | ||
Updated•15 years ago
|
URL: Object.getPrototypeOf(event.construct...
| Assignee | ||
Updated•15 years ago
|
URL: Object.getPrototypeOf(event.construct... → https://github.com/mozilla/addon-sdk/...
| Assignee | ||
Updated•15 years ago
|
| Assignee | ||
Comment 3•15 years ago
|
||
Attachment #493670 -
Flags: review?(myk)
| Reporter | ||
Comment 4•15 years ago
|
||
Comment on attachment 493670 [details] [diff] [review]
https://github.com/mozilla/addon-sdk/pull/55
> I did not manged to find out why does this bug occurs unfortunately and I
> really would like to find it out, but at the moment I would like to suggest a
> different fix, I actually thought of changing default behavior of
> `EventEmitter` from throwing on unhandled exception to a logging it, since all
> the consumers just log it anyway. Also I think that there is nothing that
> object derived from EventEmitter can do when one of the listeners throw. So
> here is a patch with a fix: https://github.com/mozilla/addon-sdk/pull/55
Yup, that makes sense.
> I also think that finding a reason why
> Object.getPrototypeOf(event.constructor.prototype) misbehaves should not be a
> beta blocker.
Agreed, since your patch works around that problem.
>+ if (type === ERROR_TYPE && !listeners.length)
>+ console.exception(event)
Nit: semi-colon after statement.
Attachment #493670 -
Flags: review?(myk) → review+
| Reporter | ||
Comment 5•15 years ago
|
||
I have cherry-picked your change with the nit fixed <https://github.com/mozilla/addon-sdk/commit/958959f0573c2128be541665e9953693ab81c49f>.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: -- → 1.0b1
| Reporter | ||
Comment 6•15 years ago
|
||
Urk, this is causing test bustage.
| Reporter | ||
Comment 7•15 years ago
|
||
Change backed out due to test bustage <https://github.com/mozilla/addon-sdk/commit/7333003537a4b7a0ec1eff447c22ee3f6e1f5ada>.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Updated•15 years ago
|
| Reporter | ||
Updated•15 years ago
|
Attachment #493947 -
Flags: review?(myk) → review+
| Assignee | ||
Updated•15 years ago
|
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•