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

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

Issue 1873833002: [elements] Add more tests to increase coverage (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/array-splice.js » ('j') | test/mjsunit/array-splice.js » ('J')
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 var a = [1,2,3]; 139 var a = [1,2,3];
140 a.f = function() { return 10; } 140 a.f = function() { return 10; }
141 f(a, 4); 141 f(a, 4);
142 f(a, 5); 142 f(a, 5);
143 f(a, 6); 143 f(a, 6);
144 %OptimizeFunctionOnNextCall(f); 144 %OptimizeFunctionOnNextCall(f);
145 f(a, 7); 145 f(a, 7);
146 f(a, {}); 146 f(a, {});
147 assertEquals(10, a.f()); 147 assertEquals(10, a.f());
148 })(); 148 })();
149
150
151 (function testDoubleArrayPush() {
152 var a = [];
153 var max = 1000;
154 for (var i = 0; i < max; i++) {
155 a.push(i + 0.1);
156 }
157 assertEquals(max, a.length);
158 for (var i = 0; i < max; i++) {
159 assertEquals(i+0.1, a[i]);
160 }
161 })();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/array-splice.js » ('j') | test/mjsunit/array-splice.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698