Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.
This repository was archived by the owner on May 30, 2023. It is now read-only.

Function.prototype.bind is undefined #10522

Closed
@kpozin

Description

@kpozin

kpozin@gmail.com commented:

Which version of PhantomJS are you using? Tip: run 'phantomjs --version'.
1.5.1 (development)

What steps will reproduce the problem?

  1. Run phantomjs in REPL mode.
  2. Type "Function.prototype.bind" and hit Return

What is the expected output? What do you see instead?
Expected: "[Function]"
Actual: undefined

Which operating system are you using?
Win 7 x64

Did you use binary PhantomJS or did you compile it from source?
Binary

Please provide any additional information below.
Function.prototype.bind is also undefined when running scripts (non in REPL mode).

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #522.
🌟   24 people had starred this issue at the time of migration.

Activity

kpozin

kpozin commented on May 2, 2012

@kpozin
Author

kpozin@gmail.com commented:

Looks like this is failing because PhantomJS is built with an old version of JavaScriptCore that is missing the "bind" implementation.

ariya

ariya commented on Jul 18, 2012

@ariya
Owner

j...@thereitis.com commented:

Reproduced issue with version 1.6.0, Mac OS X 10.7.4, compiled from source.

creationix

creationix commented on Aug 7, 2012

@creationix

t...@creationix.com commented:

I was just bit by this bug too. We have crazy new stuff like DataView and binary websockets, but we don't have basic ES5 functions!?

phantomjs 1.6.1 on Ubuntu 12.04 x64

creationix

creationix commented on Aug 7, 2012

@creationix

t...@creationix.com commented:

I take back what I said about binary websockets. That doesn't appear to work. Sorry for the confusion.

ariya

ariya commented on Sep 28, 2012

@ariya
Owner

ariya.hi...@gmail.com commented:

This is likely solved once we fix issue #10031 (update WebKit).

ariya

ariya commented on Jan 3, 2013

@ariya
Owner

bradwill...@gmail.com commented:

I hit this issue too, still in 1.8

tupton

tupton commented on Apr 9, 2013

@tupton

Is there a current workaround for this while we wait for #10031? Simply creating a shim in my phantom runner script using this code from MDN doesn't seem to apply to the Function object that phantomjs uses. Is there somewhere else I should be trying to insert this shim?

creationix

creationix commented on Apr 9, 2013

@creationix

@tupton When I created a Function.prototype.bind polyfill, it worked fine for me. https://github.com/c9/smith/blob/master/tests/public/test.js#L2-L7

tupton

tupton commented on Apr 9, 2013

@tupton

@creationix Thanks for that pointer. I'm extremely new to phantomjs and still trying to figure out everything in context. I was trying to define Function.prototype.bind in my actual phantom script, not in my tests or test page. Moving it to my test runner page worked.

added a commit that references this issue on Apr 11, 2013
c929d91
molily

molily commented on Apr 11, 2013

@molily

“Why PhantomJS doesn't have Function.prototype.bind” by @ariya: https://groups.google.com/forum/#!msg/phantomjs/r0hPOmnCUpc/uxusqsl2LNoJ

ariya

ariya commented on Apr 11, 2013

@ariya
Owner

My long explanation is posted in https://groups.google.com/forum/#!msg/phantomjs/r0hPOmnCUpc/uxusqsl2LNoJ.

The summary:

We never intended this to happen. PhantomJS relies on QtWebKit in Qt and the last stable version of Qt (which has updated QtWebKit) was slow to emerge (for a lot of technical and non-technical reasons).

We already tried some attempts to rectify the situation. Unfortunately it's a lot of work and all the combined spare-time of our contributors is not enough to bring the solution to the table.

84 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @ariya@ralyodio@tupton@molily@alexgorbatchev

      Issue actions

        Function.prototype.bind is undefined · Issue #10522 · ariya/phantomjs