Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: test/mjsunit/regress/regress-581.js

Issue 13465008: Fix Array.prototype.concat when exceeding array size limit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-581.js
diff --git a/test/mjsunit/regress/regress-crbug-168545.js b/test/mjsunit/regress/regress-581.js
similarity index 79%
copy from test/mjsunit/regress/regress-crbug-168545.js
copy to test/mjsunit/regress/regress-581.js
index acc065e41101325dd9b105f73e50748b1c9cff13..65cd87de010c06a91952c3a7c41a4e7ab46b914e 100644
--- a/test/mjsunit/regress/regress-crbug-168545.js
+++ b/test/mjsunit/regress/regress-581.js
@@ -25,10 +25,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-var o = {};
-Object.defineProperty(o, "length", { get: function() { throw "bail"; }});
-assertThrows("new Int16Array(o);");
+var pow30 = Math.pow(2, 30);
+var pow31 = Math.pow(2, 31);
var a = [];
-Object.defineProperty(a, "0", { get: function() { throw "bail"; }});
-assertThrows("new Int16Array(a);");
+a[pow31] = 31;
+
+assertEquals(pow31 + 1, a.length);
+assertThrows(function() { a.concat(a); }, RangeError);
+
+var b = [];
+b[pow31 - 2] = 32;
+var ab = a.concat(b);
+assertEquals(2 * pow31 - 1, ab.length);
+assertEquals(31, ab[pow31]);
+assertEquals(32, ab[2 * pow31 - 1]);
+
+var c = [];
+c[pow30] = 30;
+assertThrows(function() { c.concat(c, a); }, RangeError);
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698