2011-11-02 12:10:58 -04:00
|
|
|
/**
|
|
|
|
* A module of various browser polyfills
|
|
|
|
* @file polyfill.js
|
|
|
|
*/
|
|
|
|
|
2012-04-05 18:39:10 -04:00
|
|
|
/**
|
|
|
|
* String trim function polyfill
|
|
|
|
*/
|
|
|
|
if(typeof String.prototype.trim === "undefined")
|
|
|
|
{
|
2011-11-02 12:10:58 -04:00
|
|
|
/**
|
2012-04-05 18:39:10 -04:00
|
|
|
* @private
|
2011-11-02 12:10:58 -04:00
|
|
|
*/
|
2012-04-05 18:39:10 -04:00
|
|
|
String.prototype.trim = function()
|
2011-11-03 16:04:35 -04:00
|
|
|
{
|
2012-04-05 18:39:10 -04:00
|
|
|
return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
|
|
|
|
};
|
|
|
|
}
|
2012-01-24 08:55:21 -05:00
|
|
|
|
2012-04-05 18:39:10 -04:00
|
|
|
// --------------------------------------------------------------------------
|
2012-03-29 11:58:32 -04:00
|
|
|
|
2012-04-05 18:39:10 -04:00
|
|
|
/**
|
|
|
|
* Array.isArray polyfill
|
|
|
|
*/
|
|
|
|
if (typeof Array.isArray === "undefined")
|
|
|
|
{
|
|
|
|
Array.isArray = function(v)
|
|
|
|
{
|
|
|
|
return Object.prototype.toString.apply(v) === '[object Array]';
|
|
|
|
}
|
|
|
|
}
|