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

Side by Side Diff: test/mjsunit/es6/arguments-iterator.js

Issue 1139323002: Version 4.5.1.1 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5.1
Patch Set: Created 5 years, 7 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
« no previous file with comments | « test/mjsunit/array-length.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 7
8 // Note in general that "arguments.foo" and "var o = arguments; o.foo" 8 // Note in general that "arguments.foo" and "var o = arguments; o.foo"
9 // are treated differently by full-codegen, and so both cases need to be 9 // are treated differently by full-codegen, and so both cases need to be
10 // tested. 10 // tested.
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 o[Symbol.iterator] = 10; 212 o[Symbol.iterator] = 10;
213 assertTrue(o.hasOwnProperty(Symbol.iterator)); 213 assertTrue(o.hasOwnProperty(Symbol.iterator));
214 assertEquals(10, o[Symbol.iterator]); 214 assertEquals(10, o[Symbol.iterator]);
215 assertSame([][Symbol.iterator], arguments[Symbol.iterator]); 215 assertSame([][Symbol.iterator], arguments[Symbol.iterator]);
216 216
217 // Frozen o. 217 // Frozen o.
218 o = Object.freeze({__proto__:arguments}); 218 o = Object.freeze({__proto__:arguments});
219 assertSame([][Symbol.iterator], o[Symbol.iterator]); 219 assertSame([][Symbol.iterator], o[Symbol.iterator]);
220 assertFalse(o.hasOwnProperty(Symbol.iterator)); 220 assertFalse(o.hasOwnProperty(Symbol.iterator));
221 assertSame([][Symbol.iterator], o[Symbol.iterator]); 221 assertSame([][Symbol.iterator], o[Symbol.iterator]);
222 assertThrows(function () { o[Symbol.iterator] = 10 }); 222 // This should throw, but currently it doesn't, because
223 // ExecutableAccessorInfo callbacks don't see the current strict mode.
224 // See note in accessors.cc:SetPropertyOnInstanceIfInherited.
225 o[Symbol.iterator] = 10;
223 assertFalse(o.hasOwnProperty(Symbol.iterator)); 226 assertFalse(o.hasOwnProperty(Symbol.iterator));
224 assertEquals([][Symbol.iterator], o[Symbol.iterator]); 227 assertEquals([][Symbol.iterator], o[Symbol.iterator]);
225 assertSame([][Symbol.iterator], arguments[Symbol.iterator]); 228 assertSame([][Symbol.iterator], arguments[Symbol.iterator]);
226 } 229 }
227 TestArgumentsAsProto(); 230 TestArgumentsAsProto();
OLDNEW
« no previous file with comments | « test/mjsunit/array-length.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698