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

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

Issue 1242623002: [es6] Array.prototype[Symbol.iterator].name should be 'values' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « src/array-iterator.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 29 matching lines...) Expand all
40 assertEquals(desc.writable, !(attrs & READ_ONLY)); 40 assertEquals(desc.writable, !(attrs & READ_ONLY));
41 assertEquals(desc.enumerable, !(attrs & DONT_ENUM)); 41 assertEquals(desc.enumerable, !(attrs & DONT_ENUM));
42 assertEquals(desc.configurable, !(attrs & DONT_DELETE)); 42 assertEquals(desc.configurable, !(attrs & DONT_DELETE));
43 } 43 }
44 44
45 45
46 function TestArrayPrototype() { 46 function TestArrayPrototype() {
47 assertHasOwnProperty(Array.prototype, 'entries', DONT_ENUM); 47 assertHasOwnProperty(Array.prototype, 'entries', DONT_ENUM);
48 assertHasOwnProperty(Array.prototype, 'keys', DONT_ENUM); 48 assertHasOwnProperty(Array.prototype, 'keys', DONT_ENUM);
49 assertHasOwnProperty(Array.prototype, Symbol.iterator, DONT_ENUM); 49 assertHasOwnProperty(Array.prototype, Symbol.iterator, DONT_ENUM);
50 assertEquals('entries', Array.prototype.entries.name);
51 assertEquals('keys', Array.prototype.keys.name);
52 assertEquals('values', Array.prototype[Symbol.iterator].name);
50 } 53 }
51 TestArrayPrototype(); 54 TestArrayPrototype();
52 55
53 56
54 function assertIteratorResult(value, done, result) { 57 function assertIteratorResult(value, done, result) {
55 assertEquals({value: value, done: done}, result); 58 assertEquals({value: value, done: done}, result);
56 } 59 }
57 60
58 61
59 function TestValues() { 62 function TestValues() {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 function TestNonOwnSlots() { 249 function TestNonOwnSlots() {
247 var array = [0]; 250 var array = [0];
248 var iterator = array[Symbol.iterator](); 251 var iterator = array[Symbol.iterator]();
249 var object = {__proto__: iterator}; 252 var object = {__proto__: iterator};
250 253
251 assertThrows(function() { 254 assertThrows(function() {
252 object.next(); 255 object.next();
253 }, TypeError); 256 }, TypeError);
254 } 257 }
255 TestNonOwnSlots(); 258 TestNonOwnSlots();
OLDNEW
« no previous file with comments | « src/array-iterator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698