proxybugWithLdFld.js 1.0 KB

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. // -nonative
  6. // -maxsimplejitruncount:2 -maxinterpretcount:1 -forcejitloopbody -off:bailonnoprofile
  7. function test() {
  8. var count = 0;
  9. function leaf() {
  10. }
  11. var obj0 = {};
  12. var func1 = function () {
  13. for (var _strvar0 in ui8) {
  14. ary.unshift(this.prop0 + this.prop0);
  15. }
  16. };
  17. var ary = Array();
  18. var ui8 = new Uint8Array(1);
  19. var proxyHandler = {};
  20. proxyHandler['get'] = function () {
  21. count++;
  22. };
  23. obj0 = new Proxy(obj0, proxyHandler);
  24. ({ prop1: !func1.call(obj0, leaf, '!') });
  25. if (count != 2)
  26. print("FAIL");
  27. else
  28. print("PASS");
  29. }
  30. test();