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

Unified Diff: test/mjsunit/regress/regress-603.js

Issue 6930006: Make RegExp objects not callable. (Closed)
Patch Set: Address review comments Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/regexp-call-as-function.js ('k') | test/mjsunit/regress/regress-752.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-603.js
diff --git a/test/mjsunit/regress/regress-603.js b/test/mjsunit/regress/regress-603.js
index 7d4c32292cea9a39e271d5a79d58efc4577ee3a2..f9344ee17ab40b058da696e12984d5f1d27fd925 100644
--- a/test/mjsunit/regress/regress-603.js
+++ b/test/mjsunit/regress/regress-603.js
@@ -29,21 +29,36 @@
// not mess up the stack.
// http://code.google.com/p/v8/issues/detail?id=603
-function test0() {
- var re = /b../;
+var re = /b../;
+assertThrows(function() {
return re('abcdefghijklm') + 'z';
-}
-assertEquals('bcdz', test0());
+});
var re1 = /c../;
re1.call = Function.prototype.call;
-var test1 = re1.call(null, 'abcdefghijklm') + 'z';
-assertEquals('cdez', test1);
+assertThrows(function() {
+ re1.call(null, 'abcdefghijklm') + 'z';
+});
var re2 = /d../;
-var test2 = Function.prototype.call.call(re2, null, 'abcdefghijklm') + 'z';
-assertEquals('defz', test2);
+assertThrows(function() {
+ Function.prototype.call.call(re2, null, 'abcdefghijklm') + 'z';
+});
var re3 = /e../;
-var test3 = Function.prototype.call.apply(re3, [null, 'abcdefghijklm']) + 'z';
-assertEquals('efgz', test3);
+assertThrows(function() {
+ Function.prototype.call.apply(
+ re3, [null, 'abcdefghijklm']) + 'z';
+});
+
+var re4 = /f../;
+assertThrows(function() {
+ Function.prototype.apply.call(
+ re4, null, ['abcdefghijklm']) + 'z';
+});
+
+var re5 = /g../;
+assertThrows(function() {
+ Function.prototype.apply.apply(
+ re4, [null, ['abcdefghijklm']]) + 'z';
+});
« no previous file with comments | « test/mjsunit/regexp-call-as-function.js ('k') | test/mjsunit/regress/regress-752.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698