summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-crbug-514268.js
blob: 75d9970eed7d3af02432f82d592e3a55a32d2669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2015 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

function bar(a) {
  a.pop();
}
function foo(a) {
  assertEquals(2, a.length);
  var d;
  for (d in a) {
    bar(a);
  }
  // If this fails, bar was not called exactly once.
  assertEquals(1, a.length);
}

foo([1,2]);
foo([2,3]);
%OptimizeFunctionOnNextCall(foo);
foo([1,2]);