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
Description
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?
- Run phantomjs in REPL mode.
- Type "Function.prototype.bind" and hit Return
What is the expected output? What do you see instead?
Expected: "[Function]"
Actual: undefinedWhich operating system are you using?
Win 7 x64Did you use binary PhantomJS or did you compile it from source?
BinaryPlease 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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
kpozin commentedon May 2, 2012
kpozin@gmail.com commented:
ariya commentedon Jul 18, 2012
j...@thereitis.com commented:
creationix commentedon Aug 7, 2012
t...@creationix.com commented:
creationix commentedon Aug 7, 2012
t...@creationix.com commented:
yanfalies commentedon Aug 15, 2012
yanf...@edgespring.com commented:
ariya commentedon Sep 28, 2012
ariya.hi...@gmail.com commented:
ariya commentedon Jan 3, 2013
bradwill...@gmail.com commented:
tupton commentedon Apr 9, 2013
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 commentedon Apr 9, 2013
@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 commentedon Apr 9, 2013
@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.Add shim for `Function.prototype.bind()`
molily commentedon Apr 11, 2013
“Why PhantomJS doesn't have Function.prototype.bind” by @ariya: https://groups.google.com/forum/#!msg/phantomjs/r0hPOmnCUpc/uxusqsl2LNoJ
ariya commentedon Apr 11, 2013
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