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

Unified Diff: test/mjsunit/array-slice.js

Issue 6529032: Merge 6168:6800 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/message/testcfg.py ('k') | test/mjsunit/array-splice.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-slice.js
===================================================================
--- test/mjsunit/array-slice.js (revision 6800)
+++ test/mjsunit/array-slice.js (working copy)
@@ -231,3 +231,62 @@
func(['a', 1, undefined], 'a', 1, undefined);
func(['a', 1, undefined, void(0)], 'a', 1, undefined, void(0));
})();
+
+// Check slicing on arguments object when missing arguments get assigined.
+(function() {
+ function func(x, y) {
+ assertEquals(1, arguments.length);
+ assertEquals(undefined, y);
+ y = 239;
+ assertEquals(1, arguments.length); // arguments length is the same.
+ assertEquals([x], Array.prototype.slice.call(arguments, 0));
+ }
+
+ func('a');
+})();
+
+// Check slicing on arguments object when length property has been set.
+(function() {
+ function func(x, y) {
+ assertEquals(1, arguments.length);
+ arguments.length = 7;
+ assertEquals([x,,,,,,,], Array.prototype.slice.call(arguments, 0));
+ }
+
+ func('a');
+})();
+
+// Check slicing on arguments object when length property has been set to
+// some strange value.
+(function() {
+ function func(x, y) {
+ assertEquals(1, arguments.length);
+ arguments.length = 'foobar';
+ assertEquals([], Array.prototype.slice.call(arguments, 0));
+ }
+
+ func('a');
+})();
+
+// Check slicing on arguments object when extra argument has been added
+// via indexed assignment.
+(function() {
+ function func(x, y) {
+ assertEquals(1, arguments.length);
+ arguments[3] = 239;
+ assertEquals([x], Array.prototype.slice.call(arguments, 0));
+ }
+
+ func('a');
+})();
+
+// Check slicing on arguments object when argument has been deleted by index.
+(function() {
+ function func(x, y, z) {
+ assertEquals(3, arguments.length);
+ delete arguments[1];
+ assertEquals([x,,z], Array.prototype.slice.call(arguments, 0));
+ }
+
+ func('a', 'b', 'c');
+})();
« no previous file with comments | « test/message/testcfg.py ('k') | test/mjsunit/array-splice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698