Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/web/01_dom_exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ const nameToCodeMapping = ObjectCreate(null, {
NetworkError: { value: NETWORK_ERR },
AbortError: { value: ABORT_ERR },
URLMismatchError: { value: URL_MISMATCH_ERR },
QuotaExceededError: { value: QUOTA_EXCEEDED_ERR },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to stay for compat.

TimeoutError: { value: TIMEOUT_ERR },
InvalidNodeTypeError: { value: INVALID_NODE_TYPE_ERR },
DataCloneError: { value: DATA_CLONE_ERR },
QuotaExceededError: { value: QUOTA_EXCEEDED_ERR },
});

// Defined in WebIDL 4.3.
Expand Down
2 changes: 2 additions & 0 deletions ext/web/02_quota_exceeded_error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is now obsolete and should be deleted.
// The QuotaExceededError is now handled directly within 01_dom_exception.js
1 change: 1 addition & 0 deletions ext/web/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ deno_core::extension!(deno_web,
esm = [
"00_infra.js",
"01_dom_exception.js",
"02_quota_exceeded_error.js",
"01_mimesniff.js",
"02_event.js",
"02_structured_clone.js",
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/webstorage_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ Deno.test({ permissions: "none" }, function webStoragesReassignable() {

Deno.test(function webstorageSizeLimit() {
localStorage.clear();
assertThrows(
let err = assertThrows(
() => {
localStorage.setItem("k", "v".repeat(15 * 1024 * 1024));
},
Error,
"Exceeded maximum storage size",
DOMException,
);
assertEquals(err.name, "QuotaExceededError");
assertEquals(localStorage.getItem("k"), null);
assertThrows(
err = assertThrows(
() => {
localStorage.setItem("k".repeat(15 * 1024 * 1024), "v");
},
Error,
"Exceeded maximum storage size",
DOMException,
);
assertThrows(
assertEquals(err.name, "QuotaExceededError");
err = assertThrows(
() => {
localStorage.setItem(
"k".repeat(5 * 1024 * 1024),
"v".repeat(5 * 1024 * 1024),
);
},
Error,
"Exceeded maximum storage size",
DOMException,
);
assertEquals(err.name, "QuotaExceededError");
});

Deno.test(function webstorageProxy() {
Expand Down
Loading