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

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

Issue 2381053002: Reland "[builtins] migrate C++ String Iterator builtins to baseline TurboFan" (Closed)
Patch Set: Add the fix and test Created 4 years, 2 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/objects-debug.cc ('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 function TestStringPrototypeIterator() { 5 function TestStringPrototypeIterator() {
6 assertTrue(String.prototype.hasOwnProperty(Symbol.iterator)); 6 assertTrue(String.prototype.hasOwnProperty(Symbol.iterator));
7 assertFalse("".hasOwnProperty(Symbol.iterator)); 7 assertFalse("".hasOwnProperty(Symbol.iterator));
8 assertFalse("".propertyIsEnumerable(Symbol.iterator)); 8 assertFalse("".propertyIsEnumerable(Symbol.iterator));
9 } 9 }
10 TestStringPrototypeIterator(); 10 TestStringPrototypeIterator();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 TestForOf(); 85 TestForOf();
86 86
87 87
88 function TestNonOwnSlots() { 88 function TestNonOwnSlots() {
89 var iterator = ""[Symbol.iterator](); 89 var iterator = ""[Symbol.iterator]();
90 var object = {__proto__: iterator}; 90 var object = {__proto__: iterator};
91 91
92 assertThrows(function() { object.next(); }, TypeError); 92 assertThrows(function() { object.next(); }, TypeError);
93 } 93 }
94 TestNonOwnSlots(); 94 TestNonOwnSlots();
95
96
97 function TestSlicedStringRegression() {
98 var long_string = "abcdefhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
99 var sliced_string = long_string.substring(1);
100 var iterator = sliced_string[Symbol.iterator]();
101 }
102 TestSlicedStringRegression();
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698