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

Side by Side Diff: LayoutTests/fast/js/script-tests/object-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, 4 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 prototype of an object used for indexed sto rage works even if it is done after objects with indexed storage are allocated."
3 );
4
5 function Cons() {
6 }
7
8 var ouches = 0;
9
10 function foo(haveABadTime) {
11 var result = new Cons();
12 result.length = 5;
13 for (var i = 0; i < result.length; ++i) {
14 if (i == haveABadTime) {
15 debug("Henceforth I will have a bad time.");
16 Cons.prototype.__defineSetter__("3", function() { debug("Ouch!"); ou ches++; });
17 }
18 result[i] = i;
19 }
20 return result;
21 }
22
23 var expected = "\"0,1,2,3,4\"";
24
25 for (var i = 0; i < 1000; ++i) {
26 var haveABadTime;
27 if (i == 950) {
28 haveABadTime = 2;
29 expected = "\"0,1,2,,4\"";
30 } else
31 haveABadTime = -1;
32 shouldBe("\"" + Array.prototype.join.apply(foo(haveABadTime), [","]) + "\"", expected);
33 }
34
35 shouldBe("ouches", "50");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698