iterator-prototype.js 686 Bytes
Newer Older
1 2 3 4
// 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.

5
(function(global, utils) {
6 7 8 9
  "use strict";
  %CheckIsBootstrapping();

  var GlobalObject = global.Object;
10
  var IteratorPrototype = utils.ImportNow("IteratorPrototype");
11
  var iteratorSymbol = utils.ImportNow("iterator_symbol");
12 13 14 15 16 17

  // 25.1.2.1 %IteratorPrototype% [ @@iterator ] ( )
  function IteratorPrototypeIterator() {
    return this;
  }

18
  utils.SetFunctionName(IteratorPrototypeIterator, iteratorSymbol);
19
  %AddNamedProperty(IteratorPrototype, iteratorSymbol,
20 21
      IteratorPrototypeIterator, DONT_ENUM);
})