Commit 5c779700 authored by Caitlin Potter's avatar Caitlin Potter Committed by Commit Bot

[esnext] use variadic arguments for Object.fromEntries

This makes the deoptimizer happy, and is more consistent with other
Torque JS functions.

BUG=chromium:912504, v8:8021
R=tebbi@chromium.org, danno@chromium.org, mvstanton@chromium.org, gsathya@chromium.org

Change-Id: I4c86db9549c367dfab7f76b49a0cf3c69d3ec50b
Reviewed-on: https://chromium-review.googlesource.com/c/1366397
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58161}
parent dc6eed6a
...@@ -33,8 +33,9 @@ namespace object { ...@@ -33,8 +33,9 @@ namespace object {
} }
transitioning javascript builtin transitioning javascript builtin
ObjectFromEntries(implicit context: Context)(receiver: Object): Object { ObjectFromEntries(implicit context: Context)(receiver: Object, ...arguments):
const iterable: Object = receiver; Object {
const iterable: Object = arguments[0];
try { try {
if (IsNullOrUndefined(iterable)) goto Throw; if (IsNullOrUndefined(iterable)) goto Throw;
return ObjectFromEntriesFastCase(iterable) otherwise IfSlow; return ObjectFromEntriesFastCase(iterable) otherwise IfSlow;
......
// Copyright 2018 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.
// Flags: --always-opt --harmony-object-from-entries --allow-natives-syntax
function test() {
Object.fromEntries([[]]);
%DeoptimizeNow();
}
test();
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