JavascriptStringIterator.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. class JavascriptStringIterator : public DynamicObject
  9. {
  10. private:
  11. Field(JavascriptString*) m_string;
  12. Field(charcount_t) m_nextIndex;
  13. protected:
  14. DEFINE_VTABLE_CTOR(JavascriptStringIterator, DynamicObject);
  15. DEFINE_MARSHAL_OBJECT_TO_SCRIPT_CONTEXT(JavascriptStringIterator);
  16. public:
  17. JavascriptStringIterator(DynamicType* type, JavascriptString* string);
  18. class EntryInfo
  19. {
  20. public:
  21. static FunctionInfo Next;
  22. };
  23. static Var EntryNext(RecyclableObject* function, CallInfo callInfo, ...);
  24. public:
  25. JavascriptString* GetStringForHeapEnum() { return m_string; }
  26. };
  27. template <> inline bool VarIsImpl<JavascriptStringIterator>(RecyclableObject* obj)
  28. {
  29. return JavascriptOperators::GetTypeId(obj) == TypeIds_StringIterator;
  30. }
  31. } // namespace Js