Revision: 19369
Author: [email protected]
Date: Fri Feb 14 09:33:03 2014 UTC
Log: Fix typed array error message.
[email protected]
BUG=v8:3159
LOG=N
Review URL: https://codereview.chromium.org/163293002
http://code.google.com/p/v8/source/detail?r=19369
Added:
/branches/bleeding_edge/test/mjsunit/regress/regress-3159.js
Modified:
/branches/bleeding_edge/src/messages.js
/branches/bleeding_edge/src/typedarray.js
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-3159.js Fri Feb 14
09:33:03 2014 UTC
@@ -0,0 +1,10 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+try {
+ new Uint32Array(new ArrayBuffer(1), 2, 3);
+} catch (e) {
+ assertEquals("start offset of Uint32Array should be a multiple of 4",
+ e.message);
+}
=======================================
--- /branches/bleeding_edge/src/messages.js Wed Feb 12 15:50:23 2014 UTC
+++ /branches/bleeding_edge/src/messages.js Fri Feb 14 09:33:03 2014 UTC
@@ -120,7 +120,7 @@
invalid_string_length: ["Invalid string length"],
invalid_typed_array_offset: ["Start offset is too large:"],
invalid_typed_array_length: ["Invalid typed array length"],
- invalid_typed_array_alignment: ["%0", "of", "%1", "should be a multiple
of", "%3"],
+ invalid_typed_array_alignment: ["%0", " of ", "%1", " should be a
multiple of ", "%2"],
typed_array_set_source_too_large:
["Source is too large"],
typed_array_set_negative_offset:
=======================================
--- /branches/bleeding_edge/src/typedarray.js Tue Feb 4 09:53:05 2014 UTC
+++ /branches/bleeding_edge/src/typedarray.js Fri Feb 14 09:33:03 2014 UTC
@@ -58,7 +58,7 @@
if (offset % ELEMENT_SIZE !== 0) {
throw MakeRangeError("invalid_typed_array_alignment",
- "start offset", "NAME", ELEMENT_SIZE);
+ ["start offset", "NAME", ELEMENT_SIZE]);
}
if (offset > bufferByteLength) {
throw MakeRangeError("invalid_typed_array_offset");
@@ -70,7 +70,7 @@
if (IS_UNDEFINED(length)) {
if (bufferByteLength % ELEMENT_SIZE !== 0) {
throw MakeRangeError("invalid_typed_array_alignment",
- "byte length", "NAME", ELEMENT_SIZE);
+ ["byte length", "NAME", ELEMENT_SIZE]);
}
newByteLength = bufferByteLength - offset;
newLength = newByteLength / ELEMENT_SIZE;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.