I'm thinking that the unit tests should be run against the non-prototype-augmented functions. For example, poly's array.map should be tested by calling array.map(testArray, mapFunc) rather than testArray.map(mapFunc). That way, poly's shims can be fully tested in any environment, rather than only in envs that need shimming.
Then there could be separate unit tests to actually test whether poly's shimming mechanism itself works correctly. What do you think?
I'm thinking that the unit tests should be run against the non-prototype-augmented functions. For example, poly's array.map should be tested by calling
array.map(testArray, mapFunc)
rather thantestArray.map(mapFunc)
. That way, poly's shims can be fully tested in any environment, rather than only in envs that need shimming.Then there could be separate unit tests to actually test whether poly's shimming mechanism itself works correctly. What do you think?