Skip to content

Commit 4cd6fa6

Browse files
committed
fix a es3 reserved word usage, close #980
1 parent 9f0fc9e commit 4cd6fa6

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
- [Accessible `Object.prototype.hasOwnProperty` (`Object.hasOwn`) proposal](https://github.com/tc39/proposal-accessible-object-hasownproperty) moved to the stable ES, [per August 2021 TC39 meeting](https://github.com/babel/proposals/issues/76#issuecomment-909288348)
44
- [Relative indexing method (`.at`) proposal](https://github.com/tc39/proposal-relative-indexing-method) moved to the stable ES, [per August 2021 TC39 meeting](https://github.com/babel/proposals/issues/76#issuecomment-909285053)
55
- Exposed by default the stable version of `String.prototype.at`. It was not exposed because of the conflict with the alternative obsolete proposal (that will be completely removed in the next major version). For the backward compatibility, in the case of loading this proposal, it will be overwritten.
6-
- Some more iteration closing fixes
6+
- Some more iteration closing fixes
7+
- Fixed a ES3 reserved word usage, [#980](https://github.com/zloirock/core-js/issues/980)
78

89
##### 3.16.4 - 2021.08.29
910
- `AsyncFromSyncIterator` made stricter, related mainly to `AsyncIterator.from` and `AsyncIterator.prototype.flatMap`

packages/core-js/modules/web.url.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,45 +118,45 @@ var parseIPv6 = function (input) {
118118
var pointer = 0;
119119
var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
120120

121-
var char = function () {
121+
var chr = function () {
122122
return input.charAt(pointer);
123123
};
124124

125-
if (char() == ':') {
125+
if (chr() == ':') {
126126
if (input.charAt(1) != ':') return;
127127
pointer += 2;
128128
pieceIndex++;
129129
compress = pieceIndex;
130130
}
131-
while (char()) {
131+
while (chr()) {
132132
if (pieceIndex == 8) return;
133-
if (char() == ':') {
133+
if (chr() == ':') {
134134
if (compress !== null) return;
135135
pointer++;
136136
pieceIndex++;
137137
compress = pieceIndex;
138138
continue;
139139
}
140140
value = length = 0;
141-
while (length < 4 && HEX.test(char())) {
142-
value = value * 16 + parseInt(char(), 16);
141+
while (length < 4 && HEX.test(chr())) {
142+
value = value * 16 + parseInt(chr(), 16);
143143
pointer++;
144144
length++;
145145
}
146-
if (char() == '.') {
146+
if (chr() == '.') {
147147
if (length == 0) return;
148148
pointer -= length;
149149
if (pieceIndex > 6) return;
150150
numbersSeen = 0;
151-
while (char()) {
151+
while (chr()) {
152152
ipv4Piece = null;
153153
if (numbersSeen > 0) {
154-
if (char() == '.' && numbersSeen < 4) pointer++;
154+
if (chr() == '.' && numbersSeen < 4) pointer++;
155155
else return;
156156
}
157-
if (!DIGIT.test(char())) return;
158-
while (DIGIT.test(char())) {
159-
number = parseInt(char(), 10);
157+
if (!DIGIT.test(chr())) return;
158+
while (DIGIT.test(chr())) {
159+
number = parseInt(chr(), 10);
160160
if (ipv4Piece === null) ipv4Piece = number;
161161
else if (ipv4Piece == 0) return;
162162
else ipv4Piece = ipv4Piece * 10 + number;
@@ -169,10 +169,10 @@ var parseIPv6 = function (input) {
169169
}
170170
if (numbersSeen != 4) return;
171171
break;
172-
} else if (char() == ':') {
172+
} else if (chr() == ':') {
173173
pointer++;
174-
if (!char()) return;
175-
} else if (char()) return;
174+
if (!chr()) return;
175+
} else if (chr()) return;
176176
address[pieceIndex++] = value;
177177
}
178178
if (compress !== null) {

0 commit comments

Comments
 (0)