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

Side by Side Diff: test/mjsunit/array-unshift.js

Issue 12729014: Fix bogus right-shifts in Array tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« test/mjsunit/array-splice.js ('K') | « test/mjsunit/array-splice.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 assertFalse(array.hasOwnProperty(3)); 187 assertFalse(array.hasOwnProperty(3));
188 188
189 assertEquals(array[7], array_proto[7]); 189 assertEquals(array[7], array_proto[7]);
190 assertFalse(array.hasOwnProperty(7)); 190 assertFalse(array.hasOwnProperty(7));
191 })(); 191 })();
192 192
193 // Check the behaviour when approaching maximal values for length. 193 // Check the behaviour when approaching maximal values for length.
194 (function() { 194 (function() {
195 for (var i = 0; i < 7; i++) { 195 for (var i = 0; i < 7; i++) {
196 try { 196 try {
197 new Array((1 << 32) - 3).unshift(1, 2, 3, 4, 5); 197 new Array(Math.pow(2, 32) - 3).unshift(1, 2, 3, 4, 5);
198 throw 'Should have thrown RangeError'; 198 throw 'Should have thrown RangeError';
199 } catch (e) { 199 } catch (e) {
200 assertTrue(e instanceof RangeError); 200 assertTrue(e instanceof RangeError);
201 } 201 }
202 202
203 // Check smi boundary 203 // Check smi boundary
204 var bigNum = (1 << 30) - 3; 204 var bigNum = (1 << 30) - 3;
205 assertEquals(bigNum + 7, new Array(bigNum).unshift(1, 2, 3, 4, 5, 6, 7)); 205 assertEquals(bigNum + 7, new Array(bigNum).unshift(1, 2, 3, 4, 5, 6, 7));
206 } 206 }
207 })(); 207 })();
208 208
209 (function() { 209 (function() {
210 for (var i = 0; i < 7; i++) { 210 for (var i = 0; i < 7; i++) {
211 var a = [6, 7, 8, 9]; 211 var a = [6, 7, 8, 9];
212 a.unshift(1, 2, 3, 4, 5); 212 a.unshift(1, 2, 3, 4, 5);
213 assertEquals([1, 2, 3, 4, 5, 6, 7, 8, 9], a); 213 assertEquals([1, 2, 3, 4, 5, 6, 7, 8, 9], a);
214 } 214 }
215 })(); 215 })();
OLDNEW
« test/mjsunit/array-splice.js ('K') | « test/mjsunit/array-splice.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698