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

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

Issue 1199933005: Fix HTML string methods to not depend on replace method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix syntax error after git rebase Created 5 years, 6 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/string.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 // Tests taken from: 5 // Tests taken from:
6 // http://mathias.html5.org/tests/javascript/string/ 6 // http://mathias.html5.org/tests/javascript/string/
7 7
8 assertEquals('_'.anchor('b'), '<a name="b">_</a>'); 8 assertEquals('_'.anchor('b'), '<a name="b">_</a>');
9 assertEquals('<'.anchor('<'), '<a name="<"><</a>'); 9 assertEquals('<'.anchor('<'), '<a name="<"><</a>');
10 assertEquals('_'.anchor(0x2A), '<a name="42">_</a>'); 10 assertEquals('_'.anchor(0x2A), '<a name="42">_</a>');
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 'strike', 185 'strike',
186 'sub', 186 'sub',
187 'sup', 187 'sup',
188 ]; 188 ];
189 for (var name of methodNames) { 189 for (var name of methodNames) {
190 calls = 0; 190 calls = 0;
191 String.prototype[name].call(obj); 191 String.prototype[name].call(obj);
192 assertEquals(1, calls); 192 assertEquals(1, calls);
193 } 193 }
194 })(); 194 })();
195
196
197 (function TestDeleteStringRelace() {
198 assertEquals('<a name="n">s</a>', 's'.anchor('n'));
199 assertTrue(delete String.prototype.replace);
200 assertEquals('<a name="n">s</a>', 's'.anchor('n'));
201 })();
OLDNEW
« no previous file with comments | « src/string.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698