Closed
Bug 1216961
Opened 10 years ago
Closed 8 years ago
Unable to use DownloadLastDir.jsm as in documentation
Categories
(Add-on SDK Graveyard :: Documentation, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: bangar1991, Unassigned)
Details
(Keywords: APIchange, doc-bug-filed, Whiteboard: [specification][type:bug])
What did you do?
================
1. Tried to import DownloadLastDir.jsm as:
let {Cu} = require('chrome');
let gDownloadLastDir = Cu.import("resource://gre/modules/DownloadLastDir.jsm").gDownloadLastDir;
2. Proceeded to use gDownloadLastDir object.
3. Tried DownloadLastDir instead of gDownloadLastDir:
let DownloadLastDir = Cu.import("resource://gre/modules/DownloadLastDir.jsm").DownloadLastDir;
4. Proceeded to use DownloadLastDir object.
What happened?
==============
After (2), JPM shows an error saying gDownloadLastDir is undefined. After some investigating about EXPORTED_SYMBOLS property of object returned by:
let obj = Cu.import("resource://gre/modules/DownloadLastDir.jsm");
it seems that DownloadLastDir is the object being exported, not gDownloadLastDir. My testing confirmed this, so I reflected MDN documentation to the same effect, pending Technical review.
Unfortunately, even though DownloadLastDir is not undefined, I can't access any of its useful properties (like file, getFileAsync(), etc.) which are all part of its prototype object.
What should have happened?
==========================
gDownloadLastDir should have worked as documented. If the API has been updated to export DownloadLastDir instead, great. But its properties should be accessible, even those that are in the prototype (in this case all of them are in prototype).
Is there anything else we should know?
======================================
| Reporter | ||
Updated•10 years ago
|
Keywords: APIchange,
doc-bug-filed
OS: Other → Linux
Product: Mozilla Developer Network → Add-on SDK
Hardware: All → x86_64
| Reporter | ||
Updated•10 years ago
|
Component: General → Documentation
Comment 1•8 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•