[es6] Match ArrayBuffer constructor behavior of Firefox.

We choose to deliberately violate the ES2015 specification and implement
the ArrayBuffer constructor in a way that matches Firefox and Safari
instead.

BUG=v8:4592
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#32597}
This commit is contained in:
bmeurer 2015-12-03 22:05:26 -08:00 committed by Commit bot
parent 832424cf73
commit 8aae841ce2

View File

@ -1781,7 +1781,7 @@ BUILTIN(ArrayBufferConstructor_ConstructStub) {
isolate->set_context(args.target()->context());
Handle<Object> number_length;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, number_length,
Object::ToNumber(length));
Object::ToInteger(isolate, length));
size_t byte_length;
if (!TryNumberToSize(isolate, *number_length, &byte_length)) {
THROW_NEW_ERROR_RETURN_FAILURE(