Index: test/mjsunit/regress/regress-2717.js |
diff --git a/test/mjsunit/regress/regress-crbug-245424.js b/test/mjsunit/regress/regress-2717.js |
similarity index 75% |
copy from test/mjsunit/regress/regress-crbug-245424.js |
copy to test/mjsunit/regress/regress-2717.js |
index 005c8baba9492dd339b4fbdc3b48f7577b9c308a..4f8f7915b1c43e48235e7bd6bcb79f89957223cf 100644 |
--- a/test/mjsunit/regress/regress-crbug-245424.js |
+++ b/test/mjsunit/regress/regress-2717.js |
@@ -25,17 +25,27 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Test re-initializing existing field which is already being tracked as |
+// having double representation. |
+(function() { |
+ function test1(a) { |
+ return { x: 1.5, x: a }; |
+ }; |
+ |
+ assertEquals({}, test1({}).x); |
+})(); |
+ |
+// Test initializing new field which follows an existing transition to a |
+// map that tracks it as having double representation. |
+(function() { |
+ function test1(a) { |
+ return { y: a }; |
+ }; |
-function boom() { |
- var a = { |
- foo: "bar", |
- foo: "baz" |
+ function test2(a) { |
+ return { y: a }; |
}; |
- return a; |
-} |
-assertEquals("baz", boom().foo); |
-assertEquals("baz", boom().foo); |
-%OptimizeFunctionOnNextCall(boom); |
-assertEquals("baz", boom().foo); |
+ assertEquals(1.5, test1(1.5).y); |
+ assertEquals({}, test2({}).y); |
+})(); |