JavascriptMapIterator.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace Js
  7. {
  8. enum class JavascriptMapIteratorKind
  9. {
  10. Key,
  11. Value,
  12. KeyAndValue,
  13. };
  14. class JavascriptMapIterator : public DynamicObject
  15. {
  16. private:
  17. JavascriptMap* m_map;
  18. JavascriptMap::MapDataList::Iterator m_mapIterator;
  19. JavascriptMapIteratorKind m_kind;
  20. protected:
  21. DEFINE_VTABLE_CTOR(JavascriptMapIterator, DynamicObject);
  22. DEFINE_MARSHAL_OBJECT_TO_SCRIPT_CONTEXT(JavascriptMapIterator);
  23. public:
  24. JavascriptMapIterator(DynamicType* type, JavascriptMap* map, JavascriptMapIteratorKind kind);
  25. static bool Is(Var aValue);
  26. static JavascriptMapIterator* FromVar(Var aValue);
  27. class EntryInfo
  28. {
  29. public:
  30. static FunctionInfo Next;
  31. };
  32. static Var EntryNext(RecyclableObject* function, CallInfo callInfo, ...);
  33. public:
  34. JavascriptMap* GetMapForHeapEnum() { return m_map; }
  35. };
  36. } // namespace Js