forked from github/cordova-android
Throwing error on FileWriter.abort() if writer is not in the correct state. Lining up with iPhone and BlackBerry
This commit is contained in:
parent
a0c761664d
commit
7952668cf7
@ -425,6 +425,11 @@ FileWriter.DONE = 2;
|
|||||||
* Abort writing file.
|
* Abort writing file.
|
||||||
*/
|
*/
|
||||||
FileWriter.prototype.abort = function() {
|
FileWriter.prototype.abort = function() {
|
||||||
|
// check for invalid state
|
||||||
|
if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
|
||||||
|
throw FileError.INVALID_STATE_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
// set error
|
// set error
|
||||||
var error = new FileError();
|
var error = new FileError();
|
||||||
error.code = error.ABORT_ERR;
|
error.code = error.ABORT_ERR;
|
||||||
|
Loading…
Reference in New Issue
Block a user