Skip to content
New issue

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

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

Already on GitHub? # to your account

PhantomJS is missing Function.prototype.bind #3

Open
mitar opened this issue Jun 28, 2013 · 1 comment
Open

PhantomJS is missing Function.prototype.bind #3

mitar opened this issue Jun 28, 2013 · 1 comment

Comments

@mitar
Copy link
Collaborator

mitar commented Jun 28, 2013

PhantomJS is missing Function.prototype.bind:

So code which uses it fails to test. There is a workaround. Is there a way to include that somehow before all other code is run?

@mitar
Copy link
Collaborator Author

mitar commented Jun 29, 2013

I am using such code for me:

if Meteor.isClient and /PhantomJS/.test window.navigator.userAgent
  # PhantomJS (used for testing on Travis CI) does not have Function.prototype.bind and pdf.js is using it
  # https://github.com/ariya/phantomjs/issues/10522

  if !Function.prototype.bind
    Function.prototype.bind = (oThis, args...) ->
      _.bind this, oThis, args...

The code from Mozilla didn't really work for me in all cases and tests were failing from strange reasons connected with how bind operated. This code made them work.

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

No branches or pull requests

1 participant