avoid prototype builtin hasOwnProperty (#2144)

This commit is contained in:
迷渡 2019-04-19 09:56:33 +08:00 committed by Ryan Dahl
parent 2be7e44403
commit d0cd7a39a2
6 changed files with 74 additions and 7 deletions

View file

@ -32,4 +32,22 @@ test(function blobSlice() {
assertEquals(b4.size, blob.size);
});
test(function blobShouldNotThrowError() {
let hasThrown = false;
try {
const options1: object = {
ending: "utf8",
hasOwnProperty: "hasOwnProperty"
};
const options2: object = Object.create(null);
new Blob(["Hello World"], options1);
new Blob(["Hello World"], options2);
} catch {
hasThrown = true;
}
assertEquals(hasThrown, false);
});
// TODO(qti3e) Test the stored data in a Blob after implementing FileReader API.