diff options
author | 迷渡 <justjavac@gmail.com> | 2019-04-19 09:56:33 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-18 21:56:33 -0400 |
commit | d0cd7a39a2d05343c5501dc286bb59096659654f (patch) | |
tree | adffb215b15e8ca3411db732f5604158e5ab9640 /js/blob_test.ts | |
parent | 2be7e4440339f616a37b9535cc38936f80efc0e1 (diff) |
avoid prototype builtin hasOwnProperty (#2144)
Diffstat (limited to 'js/blob_test.ts')
-rw-r--r-- | js/blob_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/blob_test.ts b/js/blob_test.ts index 1e8ec8fbd..3c778a0e1 100644 --- a/js/blob_test.ts +++ b/js/blob_test.ts @@ -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. |