Commit f8228552 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Revert "Use %_IsSmi instead of %MaxSmi."

This reverts r17983.

TBR=danno@chromium.org

Review URL: https://codereview.chromium.org/79263005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17984 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 166b0c83
......@@ -86,8 +86,8 @@ macro TYPED_ARRAY_CONSTRUCTOR(ARRAY_ID, NAME, ELEMENT_SIZE)
function NAMEConstructByLength(obj, length) {
var l = IS_UNDEFINED(length) ?
0 : ToPositiveInteger(length, "invalid_typed_array_length");
if (!%_IsSmi(l)) {
0 : ToPositiveInteger(length, "invalid_typed_array_length");
if (l > %MaxSmi()) {
throw MakeRangeError("invalid_typed_array_length");
}
var byteLength = l * ELEMENT_SIZE;
......@@ -98,7 +98,7 @@ macro TYPED_ARRAY_CONSTRUCTOR(ARRAY_ID, NAME, ELEMENT_SIZE)
function NAMEConstructByArrayLike(obj, arrayLike) {
var length = arrayLike.length;
var l = ToPositiveInteger(length, "invalid_typed_array_length");
if (!%TypedArrayInitializeFromArrayLike(obj, ARRAY_ID, arrayLike, l)) {
if(!%TypedArrayInitializeFromArrayLike(obj, ARRAY_ID, arrayLike, l)) {
for (var i = 0; i < l; i++) {
// It is crucial that we let any execptions from arrayLike[i]
// propagate outside the function.
......@@ -108,6 +108,7 @@ macro TYPED_ARRAY_CONSTRUCTOR(ARRAY_ID, NAME, ELEMENT_SIZE)
}
function NAMEConstructor(arg1, arg2, arg3) {
if (%_IsConstructCall()) {
if (IS_ARRAYBUFFER(arg1)) {
NAMEConstructByArrayBuffer(this, arg1, arg2, arg3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment