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

Side by Side Diff: test/mjsunit/regexp.js

Issue 1448933002: Introduce a BuiltinsConstructStub that sets up new.target and does a [[call]] per ES6 9.3.2 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/mjsunit.js ('k') | test/mjsunit/regress/regress-crbug-435825.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // arguments: 268 // arguments:
269 re = new RegExp(); 269 re = new RegExp();
270 // KJS actually shows this as '//'. Here we match the Firefox behavior (ie, 270 // KJS actually shows this as '//'. Here we match the Firefox behavior (ie,
271 // giving a syntactically legal regexp literal). 271 // giving a syntactically legal regexp literal).
272 assertEquals('/(?:)/', re.toString()); 272 assertEquals('/(?:)/', re.toString());
273 re = new RegExp(void 0); 273 re = new RegExp(void 0);
274 assertEquals('/(?:)/', re.toString()); 274 assertEquals('/(?:)/', re.toString());
275 re.compile(); 275 re.compile();
276 assertEquals('/(?:)/', re.toString()); 276 assertEquals('/(?:)/', re.toString());
277 re.compile(void 0); 277 re.compile(void 0);
278 assertEquals('/undefined/', re.toString()); 278 assertEquals('/(?:)/', re.toString());
279 279
280 280
281 // Check for lazy RegExp literal creation 281 // Check for lazy RegExp literal creation
282 function lazyLiteral(doit) { 282 function lazyLiteral(doit) {
283 if (doit) return "".replace(/foo(/gi, ""); 283 if (doit) return "".replace(/foo(/gi, "");
284 return true; 284 return true;
285 } 285 }
286 286
287 assertTrue(lazyLiteral(false)); 287 assertTrue(lazyLiteral(false));
288 assertThrows("lazyLiteral(true)"); 288 assertThrows("lazyLiteral(true)");
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 // Test that RegExp.prototype.toString() throws TypeError for 715 // Test that RegExp.prototype.toString() throws TypeError for
716 // incompatible receivers (ES5 section 15.10.6 and 15.10.6.4). 716 // incompatible receivers (ES5 section 15.10.6 and 15.10.6.4).
717 assertThrows("RegExp.prototype.toString.call(null)", TypeError); 717 assertThrows("RegExp.prototype.toString.call(null)", TypeError);
718 assertThrows("RegExp.prototype.toString.call(0)", TypeError); 718 assertThrows("RegExp.prototype.toString.call(0)", TypeError);
719 assertThrows("RegExp.prototype.toString.call('')", TypeError); 719 assertThrows("RegExp.prototype.toString.call('')", TypeError);
720 assertThrows("RegExp.prototype.toString.call(false)", TypeError); 720 assertThrows("RegExp.prototype.toString.call(false)", TypeError);
721 assertThrows("RegExp.prototype.toString.call(true)", TypeError); 721 assertThrows("RegExp.prototype.toString.call(true)", TypeError);
722 assertThrows("RegExp.prototype.toString.call([])", TypeError); 722 assertThrows("RegExp.prototype.toString.call([])", TypeError);
723 assertThrows("RegExp.prototype.toString.call({})", TypeError); 723 assertThrows("RegExp.prototype.toString.call({})", TypeError);
724 assertThrows("RegExp.prototype.toString.call(function(){})", TypeError); 724 assertThrows("RegExp.prototype.toString.call(function(){})", TypeError);
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.js ('k') | test/mjsunit/regress/regress-crbug-435825.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698