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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 1106633002: Wrap messages implementation in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@messages_5
Patch Set: fix and rebase Created 5 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 unified diff | Download patch
« no previous file with comments | « src/mirror-debugger.js ('k') | tools/js2c.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 arg = ReadString(&data[pos]); 1349 arg = ReadString(&data[pos]);
1350 args_array = factory->NewJSArray(1); 1350 args_array = factory->NewJSArray(1);
1351 i::JSArray::SetElement(args_array, 0, v8::Utils::OpenHandle(*v8_str(arg)), 1351 i::JSArray::SetElement(args_array, 0, v8::Utils::OpenHandle(*v8_str(arg)),
1352 NONE, i::SLOPPY).Check(); 1352 NONE, i::SLOPPY).Check();
1353 } else { 1353 } else {
1354 CHECK_EQ(0, arg_count); 1354 CHECK_EQ(0, arg_count);
1355 args_array = factory->NewJSArray(0); 1355 args_array = factory->NewJSArray(0);
1356 } 1356 }
1357 1357
1358 i::Handle<i::JSObject> builtins(isolate->js_builtins_object()); 1358 i::Handle<i::JSObject> builtins(isolate->js_builtins_object());
1359 i::Handle<i::Object> format_fun = i::Object::GetProperty( 1359 i::Handle<i::Object> format_fun =
1360 isolate, builtins, "FormatMessage").ToHandleChecked(); 1360 i::Object::GetProperty(isolate, builtins, "$formatMessage")
1361 .ToHandleChecked();
1361 i::Handle<i::Object> arg_handles[] = { format, args_array }; 1362 i::Handle<i::Object> arg_handles[] = { format, args_array };
1362 i::Handle<i::Object> result = i::Execution::Call( 1363 i::Handle<i::Object> result = i::Execution::Call(
1363 isolate, format_fun, builtins, 2, arg_handles).ToHandleChecked(); 1364 isolate, format_fun, builtins, 2, arg_handles).ToHandleChecked();
1364 CHECK(result->IsString()); 1365 CHECK(result->IsString());
1365 i::DeleteArray(message); 1366 i::DeleteArray(message);
1366 i::DeleteArray(arg); 1367 i::DeleteArray(arg);
1367 data.Dispose(); 1368 data.Dispose();
1368 return i::Handle<i::String>::cast(result); 1369 return i::Handle<i::String>::cast(result);
1369 } 1370 }
1370 1371
(...skipping 4965 matching lines...) Expand 10 before | Expand all | Expand 10 after
6336 v8::Script::Compile(v8_str(script3)); 6337 v8::Script::Compile(v8_str(script3));
6337 CHECK(try_catch2.HasCaught()); 6338 CHECK(try_catch2.HasCaught());
6338 v8::String::Utf8Value exception(try_catch2.Exception()); 6339 v8::String::Utf8Value exception(try_catch2.Exception());
6339 CHECK_EQ(0, 6340 CHECK_EQ(0,
6340 strcmp( 6341 strcmp(
6341 "ReferenceError: In strong mode, using an undeclared global " 6342 "ReferenceError: In strong mode, using an undeclared global "
6342 "variable 'not_there3' is not allowed", 6343 "variable 'not_there3' is not allowed",
6343 *exception)); 6344 *exception));
6344 } 6345 }
6345 } 6346 }
OLDNEW
« no previous file with comments | « src/mirror-debugger.js ('k') | tools/js2c.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698