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

Unified Diff: test/cctest/test-parsing.cc

Issue 273653002: Parser / PreParser: Simplify error message arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 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/preparser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 58734d054e2d67ddb15d036213cc91ff7a3f2150..80a116f1155b592213285f4c7e23182dcfcc0646 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -1147,12 +1147,12 @@ i::Handle<i::String> FormatMessage(i::ScriptData* data) {
const char* message = data->BuildMessage();
i::Handle<i::String> format = v8::Utils::OpenHandle(
*v8::String::NewFromUtf8(CcTest::isolate(), message));
- i::Vector<const char*> args = data->BuildArgs();
- i::Handle<i::JSArray> args_array = factory->NewJSArray(args.length());
- for (int i = 0; i < args.length(); i++) {
+ const char* arg = data->BuildArg();
+ i::Handle<i::JSArray> args_array = factory->NewJSArray(arg == NULL ? 0 : 1);
+ if (arg != NULL) {
i::JSArray::SetElement(
- args_array, i, v8::Utils::OpenHandle(*v8::String::NewFromUtf8(
- CcTest::isolate(), args[i])),
+ args_array, 0, v8::Utils::OpenHandle(*v8::String::NewFromUtf8(
+ CcTest::isolate(), arg)),
NONE, i::SLOPPY).Check();
}
i::Handle<i::JSObject> builtins(isolate->js_builtins_object());
@@ -1162,11 +1162,8 @@ i::Handle<i::String> FormatMessage(i::ScriptData* data) {
i::Handle<i::Object> result = i::Execution::Call(
isolate, format_fun, builtins, 2, arg_handles).ToHandleChecked();
CHECK(result->IsString());
- for (int i = 0; i < args.length(); i++) {
- i::DeleteArray(args[i]);
- }
- i::DeleteArray(args.start());
i::DeleteArray(message);
+ i::DeleteArray(arg);
return i::Handle<i::String>::cast(result);
}
« no previous file with comments | « src/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698