ObjectHeaderInlining_NewPropSharedInlineCache.js 760 B

1234567891011121314151617181920212223242526
  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. //reduced switches: -mic:1 -forcejitloopbody -off:interpreterautoprofile
  6. function SmallObjectConstr() {
  7. this.prop0 = 0;
  8. }
  9. var obj2 = { prop3: {} };
  10. (function () {
  11. var obj = new SmallObjectConstr();
  12. obj2.prop3 += obj.prop2++;
  13. obj.prop2++;
  14. for (var i of [1,2]) {
  15. obj.prop3 = { a: obj.prop2++ };
  16. obj.prop2 = 4;
  17. }
  18. })();
  19. WScript.Echo("PASSED");