diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-04-14 22:49:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 22:49:16 +0200 |
commit | 353e79c796efc6c6aa328abb4d7cef5e642944af (patch) | |
tree | 5ae6d1778c0a1dfa53ac62e409d6da8cdb31285f /op_crates/file | |
parent | 5214acd3d9dec56ee159544f0f6bf9834a62c097 (diff) |
chore: align FormData to spec (#10169)
This PR aligns `FormData` to spec. All WPT tests are passing.
Diffstat (limited to 'op_crates/file')
-rw-r--r-- | op_crates/file/01_file.js | 12 | ||||
-rw-r--r-- | op_crates/file/02_filereader.js | 4 | ||||
-rw-r--r-- | op_crates/file/internal.d.ts | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/op_crates/file/01_file.js b/op_crates/file/01_file.js index 17762c14a..47b44a08e 100644 --- a/op_crates/file/01_file.js +++ b/op_crates/file/01_file.js @@ -139,6 +139,10 @@ const _byteSequence = Symbol("[[ByteSequence]]"); class Blob { + get [Symbol.toStringTag]() { + return "Blob"; + } + /** @type {string} */ #type; @@ -286,10 +290,6 @@ } return bytes.buffer; } - - get [Symbol.toStringTag]() { - return "Blob"; - } } webidl.converters["Blob"] = webidl.createInterfaceConverter("Blob", Blob); @@ -336,6 +336,10 @@ const _LastModfied = Symbol("[[LastModified]]"); class File extends Blob { + get [Symbol.toStringTag]() { + return "File"; + } + /** @type {string} */ [_Name]; /** @type {number} */ diff --git a/op_crates/file/02_filereader.js b/op_crates/file/02_filereader.js index b32cbfce9..640c6dd9e 100644 --- a/op_crates/file/02_filereader.js +++ b/op_crates/file/02_filereader.js @@ -24,6 +24,10 @@ const aborted = Symbol("[[aborted]]"); class FileReader extends EventTarget { + get [Symbol.toStringTag]() { + return "FileReader"; + } + /** @type {"empty" | "loading" | "done"} */ [state] = "empty"; /** @type {null | string | ArrayBuffer} */ diff --git a/op_crates/file/internal.d.ts b/op_crates/file/internal.d.ts index 91a61d811..dd892e736 100644 --- a/op_crates/file/internal.d.ts +++ b/op_crates/file/internal.d.ts @@ -9,7 +9,7 @@ declare namespace globalThis { Blob: typeof Blob & { [globalThis.__bootstrap.file._byteSequence]: Uint8Array; }; - _byteSequence: unique symbol; + readonly _byteSequence: unique symbol; File: typeof File & { [globalThis.__bootstrap.file._byteSequence]: Uint8Array; }; |