[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: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#58161}
This commit is contained in:
parent
dc6eed6a4e
commit
5c77970094
@ -33,8 +33,9 @@ namespace object {
|
||||
}
|
||||
|
||||
transitioning javascript builtin
|
||||
ObjectFromEntries(implicit context: Context)(receiver: Object): Object {
|
||||
const iterable: Object = receiver;
|
||||
ObjectFromEntries(implicit context: Context)(receiver: Object, ...arguments):
|
||||
Object {
|
||||
const iterable: Object = arguments[0];
|
||||
try {
|
||||
if (IsNullOrUndefined(iterable)) goto Throw;
|
||||
return ObjectFromEntriesFastCase(iterable) otherwise IfSlow;
|
||||
|
11
test/mjsunit/harmony/regress/regress-912504.js
Normal file
11
test/mjsunit/harmony/regress/regress-912504.js
Normal file
@ -0,0 +1,11 @@
|
||||
// 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();
|
Loading…
Reference in New Issue
Block a user