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

Unified Diff: src/api.cc

Issue 2789223002: [api] Fix harmony formatting for CompileFunctionInContext
Patch Set: Created 3 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 | « no previous file | test/cctest/test-compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index b6f7bb77243bed6519cf86300ef3b325e545047e..43c6912d5d928b28d9b0368266e34fa7957078ae 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2298,7 +2298,7 @@ MaybeLocal<Function> ScriptCompiler::CompileFunctionInContext(
if (i::FLAG_harmony_function_tostring) {
// Append linefeed and signal that text beyond the linefeed is not part of
// the formal parameters.
- brackets = factory->NewStringFromStaticChars("\n) {");
+ brackets = factory->NewStringFromStaticChars("\n) {\n");
parameters_end_pos = source_string->length() + 1;
} else {
brackets = factory->NewStringFromStaticChars("){");
@@ -2309,8 +2309,8 @@ MaybeLocal<Function> ScriptCompiler::CompileFunctionInContext(
} else {
if (i::FLAG_harmony_function_tostring) {
source_string =
- factory->NewStringFromStaticChars("(function anonymous(\n) {");
- parameters_end_pos = source_string->length() - 3;
+ factory->NewStringFromStaticChars("(function anonymous(\n) {\n");
+ parameters_end_pos = source_string->length() - 4;
} else {
source_string = factory->NewStringFromStaticChars("(function(){");
}
« no previous file with comments | « no previous file | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698