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

Unified Diff: test/mjsunit/es8/syntactic-tail-call-parsing.js

Issue 1964603002: [es8] Throw SyntaxError when trying to tail call a direct eval. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@stc-strict-mode
Patch Set: Created 4 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/message/syntactic-tail-call-of-eval.out ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es8/syntactic-tail-call-parsing.js
diff --git a/test/mjsunit/es8/syntactic-tail-call-parsing.js b/test/mjsunit/es8/syntactic-tail-call-parsing.js
index 9c4cbb8c46585079cd33a580513f8b9ae9114f3d..9ceff9c59649ba1bfa451e9743f8a8e9d0381ef7 100644
--- a/test/mjsunit/es8/syntactic-tail-call-parsing.js
+++ b/test/mjsunit/es8/syntactic-tail-call-parsing.js
@@ -270,6 +270,25 @@ var SyntaxErrorTests = [
},
],
},
+ { msg: "Tail call of a direct eval is not allowed",
+ tests: [
+ { src: `()=>{ return continue eval(" foo () " ) ; }`,
+ err: ` ^^^^^^^^^^^^^^^^^`,
+ },
+ { src: `()=>{ return a || continue eval("", 1, 2) ; }`,
+ err: ` ^^^^^^^^^^^^^^`,
+ },
+ { src: `()=>{ return a, continue eval ( ) ; }`,
+ err: ` ^^^^^^^^^`,
+ },
+ { src: `()=> a, continue eval ( ) ; `,
+ err: ` ^^^^^^^^^`,
+ },
+ { src: `()=> a || continue eval (' ' ) ; `,
+ err: ` ^^^^^^^^^^^^`,
+ },
+ ],
+ },
{ msg: "Undefined label 'foo'",
tests: [
{ src: `()=>{ continue foo () ; }`,
@@ -285,6 +304,7 @@ var NoErrorTests = [
`()=>{ return continue a.b.c.foo () ; }`,
`()=>{ return continue a().b.c().d.foo () ; }`,
`()=>{ return continue foo (1)(2)(3, 4) ; }`,
+ `()=>{ return continue (0, eval)(); }`,
`()=>{ return ( continue b() ) ; }`,
"()=>{ return continue bar`ab cd ef` ; }",
"()=>{ return continue bar`ab ${cd} ef` ; }",
« no previous file with comments | « test/message/syntactic-tail-call-of-eval.out ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698