TypeError: memory.track is not a function in observer-service.js when a package includes its own memory.js module

RESOLVED FIXED in Future

Status

P3
minor
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: asqueella, Assigned: irakli)

Tracking

unspecified
Future

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [papercuts])

(Reporter)

Description

7 years ago
(Add-on SDK 1.0)

If you have a lib/memory.js in your package, cfx test will fail with:

error: An exception occurred.
Traceback (most recent call last):
  File "resource://***-api-utils-lib/observer-service.js", line 92, in add
  File "resource://***-api-utils-lib/observer-service.js", line 150, in Observer
TypeError: memory.track is not a function
FAIL

Having spent 15 minutes trying to figure it out (in hindsight it was obvious), I feel I should log this for others who might encounter this issue.


This might also be an issue with other built-in modules, in which case it might be worth to implement some kind of sanity check for this in cfx.
Priority: -- → P3
Target Milestone: --- → Future
Irakli, can you take a look at this?
I think it's just needing to explicitly specify the SDK's memory library.
Assignee: nobody → rFobic
Whiteboard: [papercuts]
Nickolay, Wes I believe this was fixed by:
https://bugzilla.mozilla.org/show_bug.cgi?id=672087

I've tested by creating memory.js in annotator example an everything seems to work fine. Nickolay can you please test your case with a code from master and see if you can still reproduce this ?
(Reporter)

Comment 3

7 years ago
Thanks! I think we can close this, since I'd test it exactly as you did and it doesn't seem to be worth the extra check.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Reporter)

Comment 4

7 years ago
By the way: Wes, it's great to have you as the bugmaster! Thanks a lot for going through the bugs.
You need to log in before you can comment on or make changes to this bug.