ES5ArrayNonIndexEnumerator.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  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. //
  9. // Enumerates only non-index named properties.
  10. //
  11. class ES5ArrayNonIndexEnumerator : public ES5ArrayEnumerator
  12. {
  13. protected:
  14. DEFINE_VTABLE_CTOR(ES5ArrayNonIndexEnumerator, ES5ArrayEnumerator);
  15. DEFINE_MARSHAL_ENUMERATOR_TO_SCRIPT_CONTEXT(ES5ArrayNonIndexEnumerator);
  16. public:
  17. ES5ArrayNonIndexEnumerator(Var originalInstance, ES5Array* arrayObject, ScriptContext* scriptContext, BOOL enumNonEnumerable, bool enumSymbols = false)
  18. : ES5ArrayEnumerator(originalInstance, arrayObject, scriptContext, enumNonEnumerable, enumSymbols)
  19. {
  20. doneArray = true;
  21. }
  22. virtual void Reset() override
  23. {
  24. __super::Reset();
  25. doneArray = true;
  26. }
  27. };
  28. }