propertyString.js 923 B

12345678910111213141516171819202122232425262728293031323334
  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. function propCacheTest()
  6. {
  7. var obj = {};
  8. var matches = "aabccddeeffaaggaabbaabaabaab".match(/((aa))/);
  9. for(var str in matches)
  10. {
  11. if(obj[matches[str]] !== undefined)
  12. {
  13. WScript.Echo("propertyFound");
  14. }
  15. }
  16. return matches;
  17. }
  18. var props = propCacheTest();
  19. for (var i = 0; i < props.length; i++)
  20. {
  21. WScript.Echo(props[i]);
  22. }
  23. CollectGarbage();
  24. CollectGarbage();
  25. CollectGarbage();
  26. props = propCacheTest();
  27. for (var i = 0; i < props.length; i++)
  28. {
  29. WScript.Echo(props[i]);
  30. }