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

Side by Side Diff: test/mjsunit/arguments-apply.js

Issue 6869007: Cleanup of mjsunit.js code and make assertEquals more strict. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/apply.js ('k') | test/mjsunit/arguments-opt.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 assertEquals(2, ShadowArguments().length); 67 assertEquals(2, ShadowArguments().length);
68 assertEquals(3, ShadowArguments()[0]); 68 assertEquals(3, ShadowArguments()[0]);
69 assertEquals(4, ShadowArguments()[1]); 69 assertEquals(4, ShadowArguments()[1]);
70 70
71 71
72 function NonObjectReceiver(receiver) { 72 function NonObjectReceiver(receiver) {
73 return ReturnReceiver.apply(receiver, arguments); 73 return ReturnReceiver.apply(receiver, arguments);
74 } 74 }
75 75
76 assertEquals(42, NonObjectReceiver(42)); 76 assertEquals(Object(42), NonObjectReceiver(42));
77 assertEquals("object", typeof NonObjectReceiver(42)); 77 assertEquals("object", typeof NonObjectReceiver(42));
78 assertTrue(NonObjectReceiver(42) instanceof Number); 78 assertInstanceof(NonObjectReceiver(42), Number);
79 assertTrue(this === NonObjectReceiver(null)); 79 assertSame(this, NonObjectReceiver(null));
80 assertTrue(this === NonObjectReceiver(void 0)); 80 assertSame(this, NonObjectReceiver(void 0));
81 81
82 82
83 function FunctionReceiver() { 83 function FunctionReceiver() {
84 return ReturnReceiver.apply(Object, arguments); 84 return ReturnReceiver.apply(Object, arguments);
85 } 85 }
86 86
87 assertTrue(Object === FunctionReceiver()); 87 assertTrue(Object === FunctionReceiver());
88 88
89 89
90 function ShadowApply() { 90 function ShadowApply() {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 assertEquals(0, ShadowArgumentsWithConstant().length); 126 assertEquals(0, ShadowArgumentsWithConstant().length);
127 assertEquals(0, ShadowArgumentsWithConstant(1).length); 127 assertEquals(0, ShadowArgumentsWithConstant(1).length);
128 assertEquals(0, ShadowArgumentsWithConstant(1, 2).length); 128 assertEquals(0, ShadowArgumentsWithConstant(1, 2).length);
129 129
130 130
131 // Make sure we can deal with unfolding lots of arguments on the 131 // Make sure we can deal with unfolding lots of arguments on the
132 // stack even in the presence of the apply optimizations. 132 // stack even in the presence of the apply optimizations.
133 var array = new Array(2048); 133 var array = new Array(2048);
134 assertEquals(2048, Global.apply(this, array).length); 134 assertEquals(2048, Global.apply(this, array).length);
OLDNEW
« no previous file with comments | « test/mjsunit/apply.js ('k') | test/mjsunit/arguments-opt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698