summaryrefslogtreecommitdiff
path: root/ext/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fetch')
-rw-r--r--ext/fetch/27_eventsource.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/fetch/27_eventsource.js b/ext/fetch/27_eventsource.js
index 02b77e88d..1ab9d8009 100644
--- a/ext/fetch/27_eventsource.js
+++ b/ext/fetch/27_eventsource.js
@@ -15,7 +15,6 @@ const {
StringPrototypeIncludes,
StringPrototypeIndexOf,
StringPrototypeSlice,
- StringPrototypeSplit,
StringPrototypeStartsWith,
StringPrototypeToLowerCase,
SymbolFor,
@@ -268,8 +267,10 @@ class EventSource extends EventTarget {
} else {
let field = chunk;
let value = "";
- if (StringPrototypeIncludes(chunk, ":")) {
- ({ 0: field, 1: value } = StringPrototypeSplit(chunk, ":"));
+ const colonIndex = StringPrototypeIndexOf(chunk, ":");
+ if (colonIndex !== -1) {
+ field = StringPrototypeSlice(chunk, 0, colonIndex);
+ value = StringPrototypeSlice(chunk, colonIndex + 1);
if (StringPrototypeStartsWith(value, " ")) {
value = StringPrototypeSlice(value, 1);
}