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

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

Issue 12653010: Fix %GetArrayKeys to not skip non-enumerable indices (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle review comments Created 7 years, 9 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 | « src/runtime.cc ('k') | test/mjsunit/array-unshift.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 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 array_proto[5] = "@5"; 99 array_proto[5] = "@5";
100 assertEquals(array[5], array_proto[5]); 100 assertEquals(array[5], array_proto[5]);
101 assertFalse(array.hasOwnProperty(5)); 101 assertFalse(array.hasOwnProperty(5));
102 102
103 assertEquals(array[3], array_proto[3]); 103 assertEquals(array[3], array_proto[3]);
104 assertFalse(array.hasOwnProperty(3)); 104 assertFalse(array.hasOwnProperty(3));
105 105
106 assertEquals(array[7], array_proto[7]); 106 assertEquals(array[7], array_proto[7]);
107 assertFalse(array.hasOwnProperty(7)); 107 assertFalse(array.hasOwnProperty(7));
108 })(); 108 })();
109
110 // Check that non-enumerable elements are treated appropriately
111 (function() {
112 var array = [1, 2, 3];
113 Object.defineProperty(array, '1', {enumerable: false});
114 assertEquals(1, array.shift());
115 assertEquals([2, 3], array);
116
117 array = [1,,3];
118 array.__proto__[1] = 2;
119 Object.defineProperty(array.__proto__, '1', {enumerable: false});
120 assertEquals(1, array.shift());
121 assertEquals([2, 3], array);
122 })();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/array-unshift.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698