tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Iterator.h (1386B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
      2 * vim: set ts=8 sts=4 et sw=4 tw=99:
      3 * This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef js_Iterator_h
      8 #define js_Iterator_h
      9 
     10 #include "js/TypeDecls.h"
     11 
     12 namespace JS {
     13 
     14 // https://tc39.es/ecma262/#sec-getiterator
     15 // GetIterator
     16 JSObject* GetIteratorObject(JSContext* cx, Handle<Value> obj, bool isAsync);
     17 
     18 // https://tc39.es/ecma262/#sec-iteratornext
     19 bool IteratorNext(JSContext* cx, Handle<JSObject*> iteratorRecord,
     20                  MutableHandle<Value> result);
     21 
     22 // https://tc39.es/ecma262/#sec-iteratorcomplete
     23 bool IteratorComplete(JSContext* cx, Handle<JSObject*> iterResult, bool* done);
     24 
     25 // https://tc39.es/ecma262/#sec-iteratorvalue
     26 bool IteratorValue(JSContext* cx, Handle<JSObject*> iterResult,
     27                   MutableHandle<Value> value);
     28 
     29 // Implements iteratorRecord.[[Iterator]]
     30 bool GetIteratorRecordIterator(JSContext* cx, Handle<JSObject*> iteratorRecord,
     31                               MutableHandle<Value> iterator);
     32 
     33 // Implements GetMethod(iterator, "return").
     34 bool GetReturnMethod(JSContext* cx, Handle<Value> iterator,
     35                     MutableHandle<Value> result);
     36 
     37 }  // namespace JS
     38 
     39 #endif /* js_Iterator_h */