webmodules / jsonp

A simple JSONP implementation
1.91k stars 332 forks source link

use indexof component #5

Closed juliangruber closed 11 years ago

juliangruber commented 11 years ago

for microsoft sucks

klipstein commented 10 years ago

In which IE does String.prototype.indexOf fail? Just stumpled upon it and wondered why a dependency to the module indexof is necessary.

juliangruber commented 10 years ago

IE9 is the first to have it, see http://kangax.github.io/es5-compat-table/#Array.prototype.indexOf

klipstein commented 10 years ago

Can't see where url can be an array and that Array.prototype.indexOf is used. It always is a string (https://github.com/LearnBoost/jsonp/blob/master/index.js#L75) and the changed operation would use String.prototype.indexOf instead, which does not require to be shimmed. I understand that the applied fix works, but it is not nescessary and introduces another dependency and a module is most easily distributable across various environments when it does not have any dependencies.

I'm writing that, because I'm currently trying to use browserify in combination with other js modules and I often find myself dowloading modules and resolving dependencies manually and I also did that for this module. Still waiting for the day where component-modules are available on npm and I can use them directly with browserify without introducing another preprocessor-step or linking directories :)

juliangruber commented 10 years ago

yeah you're right, I think I did this while grepping my code base for .indexOf