From b417abc3de44acda7caadd4e76b64e88433dd2d3 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 30 Sep 2015 14:16:07 -0700 Subject: [PATCH] try again on string startswith --- examples/controllers/handControllerGrab.js | 2 +- examples/grab.js | 2 +- examples/libraries/utils.js | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 6bd1949cd3..aaa894a887 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -104,7 +104,7 @@ function entityIsGrabbedByOther(entityID) { if (tag == getTag()) { continue; } - if (tag.startsWith("grab-")) { + if (tag.slice(0, 5) == "grab-") { return true; } } diff --git a/examples/grab.js b/examples/grab.js index 3a9ce9921d..3e0212bbba 100644 --- a/examples/grab.js +++ b/examples/grab.js @@ -27,7 +27,7 @@ function entityIsGrabbedByOther(entityID) { if (tag == getTag()) { continue; } - if (tag.startsWith("grab-")) { + if (tag.slice(0, 5) == "grab-") { return true; } } diff --git a/examples/libraries/utils.js b/examples/libraries/utils.js index 2ee9bdd5fb..f6f635c73a 100644 --- a/examples/libraries/utils.js +++ b/examples/libraries/utils.js @@ -179,9 +179,3 @@ 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; - }; -}