FLUID-4973: Function.prototype.bind is not available in IE8

Metadata

Source
FLUID-4973
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Justin Obara
Reporter
Justin Obara
Created
2013-04-08T13:02:51.017-0400
Updated
2013-04-29T09:29:17.618-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Framework

Description

IE8 does not support Function.prototype.bind. It is used in the framework as part of fluid.applyHostFunction. It appears to have been added or modified at this commit:
https://github.com/fluid-project/infusion/commit/b53ae2769bd042de4a92ef40bcbebabdba79311c

This stackoverflow post talks about a work around, linking in a MDN article:
http://stackoverflow.com/questions/11054511/how-to-handle-javascript-bind-method-missing-in-ie-8
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind

Environments

IE8

Comments

  • Justin Obara commented 2013-04-08T13:37:30.336-0400

    Added a pull-request ( https://github.com/fluid-project/infusion/pull/310 ) with a fix for this issue. It makes use of the Public Domain code from the MDN site.

  • Antranig Basman commented 2013-04-08T15:35:51.361-0400

    The call to fluid.applyHostFunction has always been guarded by a check for typeof (console.log) === "function" which always returns false on IE8. In fact we shipped this way for the Infusion 1.4 release so if we are now considering this code problematic we need a better characterisation of what the problem is. Can you produce a failing test or other demonstration to show why this fails?
    Thanks

  • Antranig Basman commented 2013-04-08T17:43:33.689-0400

    This issue was observed when testing the upcoming UIOptions branch (FLUID-4927) on UIO. It turns out that the issue was intermittent, and triggered by a race condition in the IoC Testing framework, which then tried to invoke fluid.fail. fluid.fail then invoked the new framework utility "fluid.logActivity" which then issues a bare call to fluid.applyHostFunction without the implicit checking applied by the guard mentioned in the previous comment. We should just take the opportunity to rationalise this entire area, since there is actually no useful benefit gained by the use of multi-argument console.log on IE8 and IE9 anyway - exactly the same effect could be had by args.join("").

    We should attempt to consider the previous reports of a console.log with type "function" but without a working "apply" method as apocryphal and see how far we can get before encountering the problems again. I don't see any reference to such a possibility in any of the support discussions (docs, stackoverflow,e tc.) that have been cited

  • Justin Obara commented 2013-04-09T08:41:10.206-0400

    pull-request 310 replaced by https://github.com/fluid-project/infusion/pull/311

  • Michelle D'Souza commented 2013-04-09T17:36:21.253-0400

    Pull request merged into project repo at 80108b7e5d3c066e64a0dbfc04defe04c93d4b37