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

Unified Diff: test/mjsunit/regress/regress-crbug-162085.js

Issue 11414155: Ensure double arrays are filled with holes when extended from variations of empty arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 1 month 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 | « test/mjsunit/array-natives-elements.js ('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-crbug-162085.js
diff --git a/test/mjsunit/try-finally-continue.js b/test/mjsunit/regress/regress-crbug-162085.js
similarity index 71%
copy from test/mjsunit/try-finally-continue.js
copy to test/mjsunit/regress/regress-crbug-162085.js
index b55e7acc7815065456cdc3df61335c980b1e446b..f26c711f7ad5bbafc36dcfc4e719c95b64737027 100644
--- a/test/mjsunit/try-finally-continue.js
+++ b/test/mjsunit/regress/regress-crbug-162085.js
@@ -25,48 +25,31 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Test that we correctly restore the stack when continuing from a
-// finally block inside a for-in.
+// Ensure extending an empty packed smi array with a double initializes the
+// array with holes.
+var a = [1,2,3];
+a.length = 0;
+a[0] = 1.4;
+assertEquals(undefined, a[1]);
+assertEquals(undefined, a[2]);
+assertEquals(undefined, a[3]);
-var f = 0;
-var a = [1, 2, 3];
-
-for (x in a) {
- try{
- throw 'error';
- } finally {
- f++;
- continue;
- }
+// Ensure the double array growstub initializes the array with holes.
+function grow_store(a,i,v) {
+ a[i] = v;
}
-assertEquals(3, f);
-f = 0;
-for (x in a) {
- try {
- f++;
- } finally {
- f++;
- continue;
- }
-}
-assertEquals(6, f);
+var a2 = [1.3];
+grow_store(a2,1,1.4);
+a2.length = 0;
+grow_store(a2,0,1.5);
+assertEquals(undefined, a2[1]);
+assertEquals(undefined, a2[2]);
+assertEquals(undefined, a2[3]);
-f = 0;
-for (x in a) {
- try {
- f++;
- } finally {
- try {
- throw 'error'
- } finally {
- try {
- f++;
- } finally {
- f++;
- continue;
- }
- }
- }
-}
-assertEquals(9, f);
+// Check storing objects using the double grow stub.
+var a3 = [1.3];
+var o = {};
+grow_store(a3, 1, o);
+assertEquals(1.3, a3[0]);
+assertEquals(o, a3[1]);
« no previous file with comments | « test/mjsunit/array-natives-elements.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698