|
@@ -18,27 +18,6 @@ self.console = self.console || {
|
|
self.Int32Array = self.Int32Array || Array;
|
|
self.Int32Array = self.Int32Array || Array;
|
|
self.Float32Array = self.Float32Array || Array;
|
|
self.Float32Array = self.Float32Array || Array;
|
|
|
|
|
|
-// Shims for "startsWith", "endsWith", and "trim" for browsers where this is not yet implemented
|
|
|
|
-// not sure we should have this, or at least not have it here
|
|
|
|
-
|
|
|
|
-// http://stackoverflow.com/questions/646628/javascript-startswith
|
|
|
|
-// http://stackoverflow.com/questions/498970/how-do-i-trim-a-string-in-javascript
|
|
|
|
-// http://wiki.ecmascript.org/doku.php?id=harmony%3astring_extras
|
|
|
|
-
|
|
|
|
-String.prototype.startsWith = String.prototype.startsWith || function ( str ) {
|
|
|
|
-
|
|
|
|
- return this.slice( 0, str.length ) === str;
|
|
|
|
-
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-String.prototype.endsWith = String.prototype.endsWith || function ( str ) {
|
|
|
|
-
|
|
|
|
- var t = String( str );
|
|
|
|
- var index = this.lastIndexOf( t );
|
|
|
|
- return ( -1 < index && index ) === (this.length - t.length);
|
|
|
|
-
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
String.prototype.trim = String.prototype.trim || function () {
|
|
String.prototype.trim = String.prototype.trim || function () {
|
|
|
|
|
|
return this.replace( /^\s+|\s+$/g, '' );
|
|
return this.replace( /^\s+|\s+$/g, '' );
|