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

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

Issue 14668013: Function constructor should avoid String.prototype methods (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nit Created 7 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 | « 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-2686.js
diff --git a/src/builtins-decls.h b/test/mjsunit/regress/regress-2686.js
similarity index 85%
copy from src/builtins-decls.h
copy to test/mjsunit/regress/regress-2686.js
index beb5dd1e80cce803e9b16a256d5d9f53323d6146..bd6106f9ca61e42becb5de05a64c7416e9919128 100644
--- a/src/builtins-decls.h
+++ b/test/mjsunit/regress/regress-2686.js
@@ -25,16 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_BUILTINS_DECLS_H_
-#define V8_BUILTINS_DECLS_H_
+// Check Function doesn't use String.prototype.indexOf.
-#include "arguments.h"
-
-namespace v8 {
-namespace internal {
-
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, ArrayConstructor_StubFailure);
-
-} } // namespace v8::internal
-
-#endif // V8_BUILTINS_DECLS_H_
+assertThrows(function() { Function('){ function foo(', '}') }, SyntaxError);
+String.prototype.indexOf = function () { return -1; }
+assertThrows(function() { Function('){ function foo(', '}') }, SyntaxError);
« 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