Bug 897683 - Uplift Add-on SDK to Firefox r=me

This commit is contained in:
Wes Kocher
2013-07-29 14:37:44 -07:00
parent ce1ba8d151
commit a5f4fadf52
67 changed files with 1812 additions and 1004 deletions

View File

@@ -68,19 +68,11 @@ exports.exit = function exit(code) {
appStartup.quit(code ? E_ATTEMPT : E_FORCE);
};
exports.stdout = new function() {
let write = dump
if ('logFile' in options && options.logFile) {
let mode = PR_WRONLY | PR_CREATE_FILE | PR_APPEND;
let stream = openFile(options.logFile, mode);
write = function write(data) {
let text = String(data);
stream.write(text, text.length);
stream.flush();
}
}
return Object.freeze({ write: write });
};
// Adapter for nodejs's stdout & stderr:
// http://nodejs.org/api/process.html#process_process_stdout
let stdout = Object.freeze({ write: dump, end: dump });
exports.stdout = stdout;
exports.stderr = stdout;
/**
* Returns a path of the system's or application's special directory / file
@@ -134,7 +126,7 @@ exports.build = appInfo.appBuildID;
exports.id = appInfo.ID;
/**
* The name of the application.
* The name of the application.
*/
exports.name = appInfo.name;