summaryrefslogtreecommitdiff
path: root/ext/cache
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-05-01 22:30:02 +0900
committerGitHub <noreply@github.com>2023-05-01 15:30:02 +0200
commit6728ad4203d731e555dabf89ec6157f113454ce6 (patch)
tree956dc2d403b5a6ef107c35cab1ccc259ad4d86a1 /ext/cache
parent94a148cdb6f7660518c75a3c20109bf64848f0f1 (diff)
fix(core): Use primordials for methods (#18839)
I would like to get this change into Deno before merging https://github.com/denoland/deno_lint/pull/1152
Diffstat (limited to 'ext/cache')
-rw-r--r--ext/cache/01_cache.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/cache/01_cache.js b/ext/cache/01_cache.js
index 8cbf540fa..9b5404acb 100644
--- a/ext/cache/01_cache.js
+++ b/ext/cache/01_cache.js
@@ -4,9 +4,12 @@ const core = globalThis.Deno.core;
import * as webidl from "ext:deno_webidl/00_webidl.js";
const primordials = globalThis.__bootstrap.primordials;
const {
+ ArrayPrototypePush,
+ ObjectPrototypeIsPrototypeOf,
+ StringPrototypeSplit,
+ StringPrototypeTrim,
Symbol,
TypeError,
- ObjectPrototypeIsPrototypeOf,
} = primordials;
import {
Request,
@@ -101,10 +104,10 @@ class Cache {
// Step 7.
const varyHeader = getHeader(innerResponse.headerList, "vary");
if (varyHeader) {
- const fieldValues = varyHeader.split(",");
+ const fieldValues = StringPrototypeSplit(varyHeader, ",");
for (let i = 0; i < fieldValues.length; ++i) {
const field = fieldValues[i];
- if (field.trim() === "*") {
+ if (StringPrototypeTrim(field) === "*") {
throw new TypeError("Vary header must not contain '*'");
}
}
@@ -258,7 +261,7 @@ class Cache {
statusText: meta.responseStatusText,
},
);
- responses.push(response);
+ ArrayPrototypePush(responses, response);
}
}
// Step 5.4-5.5: don't apply in this context.