2018-10-28 09:57:33 +00:00
|
|
|
// 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: --allow-natives-syntax
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
function empty() {}
|
2018-10-28 09:57:33 +00:00
|
|
|
|
|
|
|
function baz(expected, found) {
|
|
|
|
var start = "";
|
|
|
|
found.length, start + 'x';
|
|
|
|
if (expected.length === found.length) {
|
|
|
|
for (var i = 0; i < expected.length; ++i) {
|
|
|
|
empty(found[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
baz([1], new class A extends Array {}());
|
2018-10-28 09:57:33 +00:00
|
|
|
|
|
|
|
(function () {
|
|
|
|
"use strict";
|
|
|
|
function bar() {
|
2019-06-12 14:00:50 +00:00
|
|
|
baz([1, 2], arguments);
|
2018-10-28 09:57:33 +00:00
|
|
|
}
|
|
|
|
function foo() {
|
2019-06-12 14:00:50 +00:00
|
|
|
bar(2147483648, -[]);
|
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
2018-10-28 09:57:33 +00:00
|
|
|
foo();
|
|
|
|
foo();
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo();
|
|
|
|
})();
|