equiv-mismatch.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. // Check the case where not all of the upstream equiv set's types are equivalent
  6. // at a downstream access.
  7. var FixedFuncArr = [];
  8. function bar() {
  9. }
  10. FixedFuncArr.push(bar);
  11. function GetFunction() {
  12. var myFunc = FixedFuncArr.shift();
  13. FixedFuncArr.push(myFunc);
  14. return myFunc;
  15. }
  16. function PolyMorphicObjGenerator() {
  17. var obj = {};
  18. obj.fixedfunc1 = GetFunction();
  19. return obj;
  20. }
  21. function test0() {
  22. var _isntObj0 = PolyMorphicObjGenerator();
  23. var _protoObj0 = Object.create(_isntObj0);
  24. var GiantPrintArray = [];
  25. var arrObj0 = {};
  26. var func2 = function () {
  27. arrObj0.prop0;
  28. arrObj0.v2 = 1924086187;
  29. _protoObj0.fixedfunc1();
  30. GiantPrintArray.push(arrObj0.v2);
  31. };
  32. arrObj0.prop0 = 1458470962.1;
  33. CollectGarbage();
  34. CollectGarbage();
  35. func2();
  36. func2();
  37. func2();
  38. WScript.Echo(GiantPrintArray);
  39. }
  40. test0();
  41. test0();