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

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

Issue 12687002: Restore Function()'s expected string representation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 | « src/v8natives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-2470.js
diff --git a/test/mjsunit/regress/regress-2470.js b/test/mjsunit/regress/regress-2470.js
index eed381699d66de7f90f6a8ad2ff3ff59213134ab..29a0b250acb2e10919e9a8de8b3b73c57ba3cd7d 100644
--- a/test/mjsunit/regress/regress-2470.js
+++ b/test/mjsunit/regress/regress-2470.js
@@ -40,3 +40,8 @@ assertThrows('Function("a", "/*", "*/", "/**/");', SyntaxError);
assertDoesNotThrow('Function("//", "//")');
assertDoesNotThrow('Function("//", "//", "//")');
assertThrows('Function("a", "//", "//")', SyntaxError);
+
+// Some embedders rely on the string representation of the resulting
+// function in cases where no formal parameters are specified.
+var asString = Function("return 23").toString();
+assertSame("function anonymous() {\nreturn 23\n}", asString);
« no previous file with comments | « src/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698