Bug 187510 - [FileAPI] FileReader.readAsArrayBuffer(null) should throw a Type Error
Summary: [FileAPI] FileReader.readAsArrayBuffer(null) should throw a Type Error
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-10 00:35 PDT by zac spitzer
Modified: 2018-07-10 17:06 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zac spitzer 2018-07-10 00:35:26 PDT
Webkit currently just returns, all other major browsers do a type check and throw an error

var reader = new FileReader();
reader.onloadend = function(e) {
  console.log(e);
}
reader.readAsArrayBuffer(null);

https://jsbin.com/zonagopuhi/edit?html,js,console,output

https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/fileapi/FileReader.cpp#L79

Here is the Chrome commit which added type checking for FileReader
https://groups.google.com/a/chromium.org/forum/#!topic/blink-reviews/vZxyVFHJ7MU