This is not a duplicate of the JS library to simulate Internet Explorer? question about simulating Internet Explorer's CSS support; this is about JavaScript functions.
Does a JavaScript library exist which can simulate an environment like Internet Explorer's, whereas JavaScript functions are concerned?
Basically, it would remove/overwrite the functions not supported by older versions of IE (like indexOf, etc.) or at least force any call to them to be ignored somehow.
Effectively, what I'm looking for is something almost like the opposite of Underscore.js and which theoretically could even be used to test (in non-IE browsers) that Underscore.js is doing what it's meant to do.
Or is the amount of effort needed to simulate the environment so small that I can do it quickly myself? If so, how?
The use case I'm imagining:
Using this script to simulate an IE7 environment in Phantom.js's WebKit browser for automated (by Jenkins) JavaScript unit-testing with Jasmine / QUnit / etc (undecided).