summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/optimize-get-iterator-2.js
blob: 83c568dac03b2b2ff2769718b3f86e7c317a2c59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(() => {
  let returnCalled = false;

  function foo() {
    ({}).__proto__.return = () => {
      returnCalled = true;
      return { value: 3, done: true };
    };
    return 2;
  }

  assertEq(returnCalled, false);
  let [a,[b=foo()]] = [1,[],3];
  assertEq(returnCalled, true);
  assertEq(a, 1);
  assertEq(b, 2);
})();