eval-nativecodedata.js 788 B

1234567891011121314151617181920212223242526272829
  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. var f;
  6. for (var j = 0; j < 1000;j ++)
  7. {
  8. eval("f = function(o) { o.a += " + j + "; for (var i = 0; i < 2; i++) { o.a += i; }}");
  9. for (var i = 0; i < 10; i++)
  10. {
  11. var o = { a: 0 };
  12. f(o);
  13. if (o.a != j + 1)
  14. {
  15. WScript.Echo("Failed " + j + " = " + o.a);
  16. }
  17. }
  18. f = null;
  19. CollectGarbage();
  20. }
  21. f = null;
  22. CollectGarbage();