Bug 1164822 - Fix OS.File.remove not throwing with unexisting files. r=Yoric

This commit is contained in:
Alessio Placitelli 2015-05-19 14:10:17 -07:00
parent b0162ea257
commit 505181a2f7
2 changed files with 9 additions and 4 deletions

View File

@ -1012,10 +1012,15 @@ File.removeEmptyDir = function removeEmptyDir(path, options) {
* Remove an existing file.
*
* @param {string} path The name of the file.
* @param {*=} options Additional options.
* - {bool} ignoreAbsent If |false|, throw an error if the file does
* not exist. |true| by default.
*
* @throws {OS.File.Error} In case of I/O error.
*/
File.remove = function remove(path) {
File.remove = function remove(path, options) {
return Scheduler.post("remove",
[Type.path.toMsg(path)]);
[Type.path.toMsg(path), options], path);
};

View File

@ -217,8 +217,8 @@ if (this.Components) {
removeEmptyDir: function removeEmptyDir(path, options) {
return File.removeEmptyDir(Type.path.fromMsg(path), options);
},
remove: function remove(path) {
return File.remove(Type.path.fromMsg(path));
remove: function remove(path, options) {
return File.remove(Type.path.fromMsg(path), options);
},
open: function open(path, mode, options) {
let filePath = Type.path.fromMsg(path);