joshfraser / JavaScript-Name-Parser

JavaScript code to split names into their respective components (first, last, etc)
http://www.onlineaspect.com/2009/08/17/splitting-names/
111 stars 34 forks source link

remove dependency on browser-shims.js #7

Open pdeva opened 10 years ago

pdeva commented 10 years ago

the browser-shims.js file adds functions to some of the core classes of javascript. this make it unaccpetable to use the name parser library in a large project where we dont want a 3rd party lib to modify core behavior in any way.

if you reduce the dependency it will make the library acceptable to use in many, many more scenarios.

cbojar commented 10 years ago

The browser-shims.js file adds functionality that is present in modern versions of Javascript (String#trim:ES5.1, Array#indexOf:ES5.1, Array#filter:ES5.1, Array#map:ES5.1). They are there to provide these modern capabilities to very old browsers (most notably IE <= 8), and their use is common. Because they are standards, other libraries will not conflict with them (except to potentially provide the exact same shims). Where the core behavior already exists, the script does nothing. Removing them as a dependency will only make the code much more complex to achieve the same result, and will be a step backwards in terms of applying modern standards.