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

Usage shortcuts of arguments object breaks old version of WebKit #150

Closed
aaronjensen opened this issue Dec 16, 2015 · 9 comments
Closed
Labels

Comments

@aaronjensen
Copy link

Ok, this is an odd one and is more likely a (fixed) webkit issue and not a core-js issue, but I wanted to point it out here in case you wanted to do something about it.

This change: 5bcabca#diff-f68e573b7ecfc93a7afcce675b0459eaL24

Causes this error:

TypeError: 'undefined' is not an object (evaluating '$$[index++]')

On this stack in capybara-webkit:

Linux id16784 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Capybara: 2.5.0
capybara-webkit: 1.7.1
Qt: 5.0.2
WebKit: 537.21
QtWebKit: 5.1.1

But it works fine on OS X with a newer version of Qt:

Capybara: 2.5.0
capybara-webkit: 1.7.1
Qt: 5.5.1
WebKit: 538.1
QtWebKit: 5.5.1
@zloirock
Copy link
Owner

Interesting. It means this code doesn't work in this WebKit version:

(function(){
  var $$ = arguments;
  return $$[0];
})(42);

Can you confirm it?

@aaronjensen
Copy link
Author

That doesn't appear to cause it.

I also tried

(function(){ var $$ = arguments, $$len = $$.length, i = 0; while(i<$$len){ $$[i]; i++; } })(42, 43)

and that didn't cause it either. If I console.log($$) within the while loop or check it with if(!$$) {...} it doesn't repro.

@zloirock
Copy link
Owner

I have no ideas what else can cause this problem. Can you add some additional info - version, line, stack, etc?

@aaronjensen
Copy link
Author

As I mentioned in chat, I can't get much more info. Here is the line causing it:

    const props = {
      ...this.props,
      href: path + wrappedWindow.location.search,
      onClick(e) {
        e.preventDefault()
        navigationActions.changePath(path)
      },
    }

It is in a react component that is rendered several times on a page. It's only the last call to it that has the problem, all the others are fine.

@aaronjensen
Copy link
Author

It happens after maybe 80 calls to it, so it's very likely a broken optimization

@zloirock zloirock changed the title optimization causes break in old version of webkit Usage shortcuts of arguments object breaks old version of WebKit Dec 17, 2015
@aaronjensen
Copy link
Author

Great, thanks. Any chance of a 1.2.7 w/ this applied?

aaronjensen pushed a commit to substantial/core-js that referenced this issue Dec 17, 2015
@zloirock
Copy link
Owner

It's not a critical bug (a very specific engine), so I don't think makes sense publish 1.2.7. Today I'll publish 2.0.0-beta.2, stable 2.0 will be available when I will fix some other problems.

@aaronjensen
Copy link
Author

Ok, thanks. I don't think I can use 2.0 yet because too many things are pinned to 1.0 but I forked it, so it's ok. Thanks!

@zloirock
Copy link
Owner

Fixed in 2.0.

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