Add test case for SparseJoin misbehavior with getters
authoradamk@chromium.org <adamk@chromium.org>
Fri, 10 Oct 2014 17:17:00 +0000 (17:17 +0000)
committeradamk@chromium.org <adamk@chromium.org>
Fri, 10 Oct 2014 17:17:00 +0000 (17:17 +0000)
BUG=v8:3621
LOG=N
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/645703003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/mjsunit/bugs/bug-3621.js [new file with mode: 0644]

diff --git a/test/mjsunit/bugs/bug-3621.js b/test/mjsunit/bugs/bug-3621.js
new file mode 100644 (file)
index 0000000..16ddde1
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var a = [];
+var endIndex = 0xffff;
+a[endIndex] = 3;
+Object.defineProperty(a, 0, { get: function() { this[1] = 2; return 1; } });
+assertEquals('123', a.join(''));
+delete a[1];  // reset the array
+assertEquals('1,2,', a.join().slice(0, 4));