mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1230422 - FileReader should handle nested ReadAs*() calls. r=khuey
This commit is contained in:
parent
bbe59f67c6
commit
a99bdcd3e8
@ -365,6 +365,14 @@ FileReader::ReadFileContent(Blob& aBlob,
|
||||
Abort(error);
|
||||
error.SuppressException();
|
||||
|
||||
if (mReadyState == LOADING) {
|
||||
// A nested ReadAsSomething() as been called during one of the events
|
||||
// dispatched by Abort(). We have to terminate this operation in order to
|
||||
// continue the nested one.
|
||||
aRv.Throw(NS_ERROR_ABORT);
|
||||
return;
|
||||
}
|
||||
|
||||
mError = nullptr;
|
||||
SetDOMStringToNull(mResult);
|
||||
mTransferred = 0;
|
||||
|
28
dom/base/crashtests/1230422.html
Normal file
28
dom/base/crashtests/1230422.html
Normal file
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
var a = new FileReader();
|
||||
|
||||
function f() {
|
||||
a.removeEventListener("loadend", f);
|
||||
g();
|
||||
}
|
||||
|
||||
function g() {
|
||||
a.readAsBinaryString(new Blob());
|
||||
}
|
||||
|
||||
a.addEventListener("loadend", f);
|
||||
|
||||
try {
|
||||
g();
|
||||
g();
|
||||
} catch(e) {}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -205,3 +205,4 @@ load structured_clone_container_throws.html
|
||||
HTTP(..) load xhr_abortinprogress.html
|
||||
load xhr_empty_datauri.html
|
||||
load xhr_html_nullresponse.html
|
||||
load 1230422.html
|
||||
|
Loading…
Reference in New Issue
Block a user