Bug 1520162 - Part 4: Remove constant error code for ValidateTypeError helper. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 15 Jan 2019 07:06:28 -0800
changeset 514516 1fecb51398bdff95480c191a0777bf5ccf1424e4
parent 514515 44969cba88bf40040c0afa6ebb231525e6df9711
child 514517 2b951a7a429ed09e7b5717b04827408978daea01
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1520162
milestone66.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 1520162 - Part 4: Remove constant error code for ValidateTypeError helper. r=jandem
js/src/builtin/TypedArray.js
--- a/js/src/builtin/TypedArray.js
+++ b/js/src/builtin/TypedArray.js
@@ -97,17 +97,17 @@ function TypedArraySpeciesConstructor(ob
         return s;
 
     // Step 8.
     ThrowTypeError(JSMSG_NOT_CONSTRUCTOR, "@@species property of object's constructor");
 }
 
 // ES2017 draft rev 6859bb9ccaea9c6ede81d71e5320e3833b92cb3e
 // 22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
-function ValidateTypedArray(obj, error) {
+function ValidateTypedArray(obj) {
     if (IsObject(obj)) {
         /* Steps 3-5 (non-wrapped typed arrays). */
         if (IsTypedArray(obj)) {
             // GetAttachedArrayBuffer throws for detached array buffers.
             GetAttachedArrayBuffer(obj);
             return true;
         }
 
@@ -115,27 +115,27 @@ function ValidateTypedArray(obj, error) 
         if (IsPossiblyWrappedTypedArray(obj)) {
             if (PossiblyWrappedTypedArrayHasDetachedBuffer(obj))
                 ThrowTypeError(JSMSG_TYPED_ARRAY_DETACHED);
             return false;
         }
     }
 
     /* Steps 1-2. */
-    ThrowTypeError(error);
+    ThrowTypeError(JSMSG_NON_TYPED_ARRAY_RETURNED);
 }
 
 // ES2017 draft rev 6859bb9ccaea9c6ede81d71e5320e3833b92cb3e
 // 22.2.4.6 TypedArrayCreate ( constructor, argumentList )
 function TypedArrayCreateWithLength(constructor, length) {
     // Step 1.
     var newTypedArray = new constructor(length);
 
     // Step 2.
-    var isTypedArray = ValidateTypedArray(newTypedArray, JSMSG_NON_TYPED_ARRAY_RETURNED);
+    var isTypedArray = ValidateTypedArray(newTypedArray);
 
     // Step 3.
     var len;
     if (isTypedArray) {
         len = TypedArrayLength(newTypedArray);
     } else {
         len = callFunction(CallTypedArrayMethodIfWrapped, newTypedArray,
                            "TypedArrayLengthMethod");
@@ -150,17 +150,17 @@ function TypedArrayCreateWithLength(cons
 
 // ES2017 draft rev 6859bb9ccaea9c6ede81d71e5320e3833b92cb3e
 // 22.2.4.6 TypedArrayCreate ( constructor, argumentList )
 function TypedArrayCreateWithBuffer(constructor, buffer, byteOffset, length) {
     // Step 1.
     var newTypedArray = new constructor(buffer, byteOffset, length);
 
     // Step 2.
-    ValidateTypedArray(newTypedArray, JSMSG_NON_TYPED_ARRAY_RETURNED);
+    ValidateTypedArray(newTypedArray);
 
     // Step 3 (not applicable).
 
     // Step 4.
     return newTypedArray;
 }
 
 // ES2017 draft rev 6859bb9ccaea9c6ede81d71e5320e3833b92cb3e