Bug 898621 - Convert ToClampedIndex to take a Handle; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Fri, 26 Jul 2013 12:53:31 -0700
changeset 152504 41730f142283fdb7b96c49da4a643d2ce99b8b42
parent 152503 bf035bca7f6529bdc298449646fcf6f09549f3fe
child 152505 95cdd796f48126be2f0b275c1e526cd4b973422a
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs898621
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 898621 - Convert ToClampedIndex to take a Handle; r=sfink
js/src/vm/TypedArrayObject.cpp
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -93,17 +93,17 @@ ValueIsLength(const Value &v, uint32_t *
 }
 
 /*
  * Convert |v| to an array index for an array of length |length| per
  * the Typed Array Specification section 7.0, |subarray|. If successful,
  * the output value is in the range [0, length].
  */
 static bool
-ToClampedIndex(JSContext *cx, const Value &v, uint32_t length, uint32_t *out)
+ToClampedIndex(JSContext *cx, HandleValue v, uint32_t length, uint32_t *out)
 {
     int32_t result;
     if (!ToInt32(cx, v, &result))
         return false;
     if (result < 0) {
         result += length;
         if (result < 0)
             result = 0;