typed arrays: remove unnecessary special-casing

Uint32Value() on undefined is equal to 0, no need to special case it.
This commit is contained in:
Dean McNamee authored and Ben Noordhuis committed 2012-10-14 00:57:09 +02:00
1 parent 93efc7f78d
commit 47643d2ec5
1 file changed
+2 -3
+2 -3
View File
@@ -210,7 +210,7 @@ class TypedArray {
if (!args[1]->IsUndefined() && args[1]->Int32Value() < 0)
return ThrowRangeError("Byte offset out of range.");
byte_offset = args[1]->IsUndefined() ? 0 : args[1]->Uint32Value();
byte_offset = args[1]->Uint32Value();
if (args.Length() > 2) {
if (args[2]->Int32Value() < 0)
@@ -596,8 +596,7 @@ class DataView {
unsigned int byte_length =
buffer->GetIndexedPropertiesExternalArrayDataLength();
unsigned int byte_offset =
args[1]->IsUndefined() ? 0 : args[1]->Uint32Value();
unsigned int byte_offset = args[1]->Uint32Value();
if (args[1]->Int32Value() < 0 || byte_offset >= byte_length)
return ThrowRangeError("byteOffset out of range.");