v8/test/mjsunit/regress/regress-11558.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
552 B
JavaScript
Raw Normal View History

// Copyright 2021 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.
// Spread calls get rewritten to CallRuntime, which should be aware of optional
// chaining.
for (let nullish of [undefined, null]) {
const fn = nullish;
const n = nullish;
const o = {};
assertEquals(fn?.(...[], 1), undefined);
assertEquals(fn?.(...[], ...[]), undefined);
assertEquals(o.method?.(...[], 1), undefined);
assertEquals(n?.method(...[], 1), undefined);
}