Browse Source

add test case for GetFldInfoAddr bug

Matt Gardner 8 years ago
parent
commit
2ae5a63dac
2 changed files with 32 additions and 0 deletions
  1. 26 0
      test/bailout/bug12782316.js
  2. 6 0
      test/bailout/rlexe.xml

+ 26 - 0
test/bailout/bug12782316.js

@@ -0,0 +1,26 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+var o1 = {};
+var o2 = Object.create(o1);
+o2.x = 1;
+
+function foo( arg ) 
+{
+    this.caller;
+    arg.x && o1.y + o2.y; 
+    arg.x;
+};
+
+foo(o2);
+foo(o2);
+Object.defineProperty(o2, 'y', { get: function () {} });
+foo(o2);
+o1.x = {};
+foo(o1);
+Object.defineProperty(o1, 'y', { set: function () {} });
+foo(o2)
+
+WScript.Echo("PASSED");

+ 6 - 0
test/bailout/rlexe.xml

@@ -251,4 +251,10 @@
       <files>spill.js</files>
     </default>
   </test>
+  <test>
+    <default>
+      <files>bug12782316.js</files>
+      <compile-flags>-force:fieldcopyprop</compile-flags>
+    </default>
+  </test>
 </regress-exe>