Skip to content

Commit 64e00c5

Browse files
committed
cleaner
1 parent 73151f1 commit 64e00c5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

whatwg.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,16 @@ export function percentEncodeAfterEncoding(encoding, input, percentEncodeSet, sp
5252
let cp = x
5353
if (x >= 0xd8_00 && x < 0xe0_00) {
5454
if (x >= 0xdc_00 || i + 1 === len) throw new SyntaxError(E_STRICT_UNICODE)
55-
const x1 = input.charCodeAt(i + 1)
55+
const x1 = input.charCodeAt(++i)
5656
if (x1 < 0xdc_00 || x1 >= 0xe0_00) throw new SyntaxError(E_STRICT_UNICODE)
5757
cp = 0x1_00_00 + ((x1 & 0x3_ff) | ((x & 0x3_ff) << 10))
58-
i++
5958
}
6059

6160
res += `${percent(u, last, i)}%26%23${cp}%3B` // &#cp;
6261
last = i + 1 // skip current
62+
} else {
63+
u[i] = b
6364
}
64-
65-
u[i] = b
6665
}
6766

6867
res += percent(u, last)

0 commit comments

Comments
 (0)