Commit 8aae841c authored by bmeurer's avatar bmeurer Committed by Commit bot

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