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

Unified Diff: src/v8natives.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 | « no previous file | test/mjsunit/regress/regress-2686.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index db9213215f7514fd78f767dc60a660e260c63170..b2ea749c73030e82d4e7323ce9637f721dc593e7 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1767,7 +1767,9 @@ function NewFunction(arg1) { // length == 1
// If the formal parameters string include ) - an illegal
// character - it may make the combined function expression
// compile. We avoid this problem by checking for this early on.
- if (p.indexOf(')') != -1) throw MakeSyntaxError('paren_in_arg_string',[]);
+ if (%_CallFunction(p, ')', StringIndexOf) != -1) {
+ throw MakeSyntaxError('paren_in_arg_string',[]);
+ }
// If the formal parameters include an unbalanced block comment, the
// function must be rejected. Since JavaScript does not allow nested
// comments we can include a trailing block comment to catch this.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2686.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698