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

Side by Side Diff: LayoutTests/fast/js/script-tests/array-bad-time.js

Issue 20867002: Remove old tests that have been migrated to the v8 repo. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove unused script-tests as well Created 7 years, 5 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
OLDNEW
(Empty)
1 description(
2 "Tests that defining a setter on the Array prototype works even if it is done af ter arrays are allocated."
3 );
4
5 var ouches = 0;
6
7 function foo(haveABadTime) {
8 var result = [];
9 result.length = 5;
10 for (var i = 0; i < result.length; ++i) {
11 if (i == haveABadTime) {
12 debug("Henceforth I will have a bad time.");
13 Array.prototype.__defineSetter__("3", function() { debug("Ouch!"); o uches++; });
14 }
15 result[i] = i;
16 }
17 return result;
18 }
19
20 var expected = "\"0,1,2,3,4\"";
21
22 for (var i = 0; i < 1000; ++i) {
23 var haveABadTime;
24 if (i == 950) {
25 haveABadTime = 2;
26 expected = "\"0,1,2,,4\"";
27 } else
28 haveABadTime = -1;
29 shouldBe("\"" + foo(haveABadTime).join(",") + "\"", expected);
30 }
31
32 shouldBe("ouches", "50");
OLDNEW
« no previous file with comments | « LayoutTests/fast/js/script-tests/JSON-parse-reviver.js ('k') | LayoutTests/fast/js/script-tests/array-float-delete.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698