Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore reserved word in es3 ? #980

Closed
yukinotech opened this issue Sep 1, 2021 · 3 comments
Closed

ignore reserved word in es3 ? #980

yukinotech opened this issue Sep 1, 2021 · 3 comments
Labels

Comments

@yukinotech
Copy link

in /packages/core-js/modules/web.url.js There is a char .

var parseIPv6 = function (input) {
  var address = [0, 0, 0, 0, 0, 0, 0, 0];
  var pieceIndex = 0;
  var compress = null;
  var pointer = 0;
  var value, length, numbersSeen, ipv4Piece, number, swaps, swap;

  // here , char
  var char = function () {
    return input.charAt(pointer);
  };

  if (char() == ':') {
    if (input.charAt(1) != ':') return;
    pointer += 2;
    pieceIndex++;
    compress = pieceIndex;
  }
  while (char()) {
    if (pieceIndex == 8) return;
    if (char() == ':') {
      if (compress !== null) return;
      pointer++;

However in ES3 , char is a reserved word .

And in cdn https://unpkg.com/[email protected]/index.js or https://unpkg.com/[email protected]/minified.js,
char is not be transformed to _char or other indetifer , which means the cdn polyfill might not work in ie6/ie7.

@zloirock
Copy link
Owner

zloirock commented Sep 1, 2021

It seems you are right, thanks. However, I checked and it worked in IE7 recently.

@zloirock
Copy link
Owner

zloirock commented Sep 1, 2021

Strangely that ESLint does not see it, https://github.com/zloirock/core-js/blob/master/.eslintrc.js#L993 (till this week was used the default parser).

@zloirock
Copy link
Owner

zloirock commented Sep 1, 2021

The same 4f4d95e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants