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

Unified Diff: src/v8natives.js

Issue 701093003: Correctly compute line numbers in functions from the function constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 6215ab09681f9becca17d073c7ac52406b9cf60c..40199bc8759999e0cad1bb81e83f7f15bfac1120 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1846,7 +1846,7 @@ function NewFunctionString(arguments, function_token) {
// 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.
- p += '\n/' + '**/';
+ p += '/**/';
}
var body = (n > 0) ? ToString(arguments[n - 1]) : '';
return '(' + function_token + '(' + p + ') {\n' + body + '\n})';
@@ -1859,7 +1859,6 @@ function FunctionConstructor(arg1) { // length == 1
// Compile the string in the constructor and not a helper so that errors
// appear to come from here.
var f = %_CallFunction(global_proxy, %CompileString(source, true));
- %FunctionMarkNameShouldPrintAsAnonymous(f);
aandrey 2014/11/10 20:38:18 you should also update src/generator.js
Yang 2014/11/11 09:51:55 Thanks for catching this!
return f;
}

Powered by Google App Engine
This is Rietveld 408576698