OLD | NEW |
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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 i::Factory* factory = isolate->factory(); | 1244 i::Factory* factory = isolate->factory(); |
1245 const char* message = data->BuildMessage(); | 1245 const char* message = data->BuildMessage(); |
1246 i::Handle<i::String> format = v8::Utils::OpenHandle( | 1246 i::Handle<i::String> format = v8::Utils::OpenHandle( |
1247 *v8::String::NewFromUtf8(CcTest::isolate(), message)); | 1247 *v8::String::NewFromUtf8(CcTest::isolate(), message)); |
1248 i::Vector<const char*> args = data->BuildArgs(); | 1248 i::Vector<const char*> args = data->BuildArgs(); |
1249 i::Handle<i::JSArray> args_array = factory->NewJSArray(args.length()); | 1249 i::Handle<i::JSArray> args_array = factory->NewJSArray(args.length()); |
1250 for (int i = 0; i < args.length(); i++) { | 1250 for (int i = 0; i < args.length(); i++) { |
1251 i::JSArray::SetElement( | 1251 i::JSArray::SetElement( |
1252 args_array, i, v8::Utils::OpenHandle(*v8::String::NewFromUtf8( | 1252 args_array, i, v8::Utils::OpenHandle(*v8::String::NewFromUtf8( |
1253 CcTest::isolate(), args[i])), | 1253 CcTest::isolate(), args[i])), |
1254 NONE, i::SLOPPY); | 1254 NONE, i::SLOPPY).Check(); |
1255 } | 1255 } |
1256 i::Handle<i::JSObject> builtins(isolate->js_builtins_object()); | 1256 i::Handle<i::JSObject> builtins(isolate->js_builtins_object()); |
1257 i::Handle<i::Object> format_fun = | 1257 i::Handle<i::Object> format_fun = |
1258 i::GetProperty(builtins, "FormatMessage"); | 1258 i::GetProperty(builtins, "FormatMessage"); |
1259 i::Handle<i::Object> arg_handles[] = { format, args_array }; | 1259 i::Handle<i::Object> arg_handles[] = { format, args_array }; |
1260 bool has_exception = false; | 1260 bool has_exception = false; |
1261 i::Handle<i::Object> result = i::Execution::Call( | 1261 i::Handle<i::Object> result = i::Execution::Call( |
1262 isolate, format_fun, builtins, 2, arg_handles, &has_exception); | 1262 isolate, format_fun, builtins, 2, arg_handles, &has_exception); |
1263 CHECK(!has_exception); | 1263 CHECK(!has_exception); |
1264 CHECK(result->IsString()); | 1264 CHECK(result->IsString()); |
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2570 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); | 2570 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); |
2571 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, | 2571 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, |
2572 kError); | 2572 kError); |
2573 | 2573 |
2574 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); | 2574 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); |
2575 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); | 2575 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); |
2576 | 2576 |
2577 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); | 2577 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); |
2578 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); | 2578 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); |
2579 } | 2579 } |
OLD | NEW |