forcefixdataprops.js 971 B

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. var GiantPrintArray = [];
  6. function makeArrayLength() {
  7. return 100;
  8. }
  9. var obj0 = {};
  10. var obj1 = {};
  11. var func0 = function () {
  12. };
  13. var func4 = function () {
  14. obj1.method0 = --protoObj0.length;
  15. protoObj0.v1 = obj1.method0;
  16. GiantPrintArray.push(protoObj0.v1);
  17. };
  18. obj1.method0 = func0;
  19. obj1.method1 = obj1.method0;
  20. protoObj0 = Object.create(obj0);
  21. protoObj0.length = makeArrayLength();
  22. obj1.method1((func4()));
  23. obj1 = protoObj0;
  24. func4();
  25. if (GiantPrintArray[0] !== 99 || GiantPrintArray[1] !== 98) {
  26. WScript.Echo('fail');
  27. }
  28. else {
  29. WScript.Echo('pass');
  30. }