move string startswith to utils.js

This commit is contained in:
Seth Alves 2015-09-30 14:07:23 -07:00
parent f746a970de
commit c27766facb
2 changed files with 6 additions and 8 deletions

View file

@ -14,14 +14,6 @@ var MAX_SOLID_ANGLE = 0.01; // objects that appear smaller than this can't be gr
var ZERO_VEC3 = {x: 0, y: 0, z: 0};
var IDENTITY_QUAT = {x: 0, y: 0, z: 0, w: 0};
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
function getTag() {
return "grab-" + MyAvatar.sessionUUID;
}

View file

@ -179,3 +179,9 @@ pointInExtents = function(point, minPoint, maxPoint) {
(point.y >= minPoint.y && point.y <= maxPoint.y) &&
(point.z >= minPoint.z && point.z <= maxPoint.z);
}
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (str){
return this.slice(0, str.length) == str;
};
}