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 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |