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 12535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12546 | 12546 |
12547 resource_name = "test2.js"; | 12547 resource_name = "test2.js"; |
12548 v8::ScriptOrigin origin2( | 12548 v8::ScriptOrigin origin2( |
12549 v8::String::NewFromUtf8(context->GetIsolate(), resource_name), | 12549 v8::String::NewFromUtf8(context->GetIsolate(), resource_name), |
12550 v8::Integer::New(context->GetIsolate(), 7)); | 12550 v8::Integer::New(context->GetIsolate(), 7)); |
12551 script = v8::Script::Compile(source, &origin2); | 12551 script = v8::Script::Compile(source, &origin2); |
12552 CheckTryCatchSourceInfo(script, resource_name, 7); | 12552 CheckTryCatchSourceInfo(script, resource_name, 7); |
12553 } | 12553 } |
12554 | 12554 |
12555 | 12555 |
| 12556 THREADED_TEST(TryCatchSourceInfoForEOSError) { |
| 12557 LocalContext context; |
| 12558 v8::HandleScope scope(context->GetIsolate()); |
| 12559 v8::TryCatch try_catch; |
| 12560 v8::Script::Compile(v8_str("!\n")); |
| 12561 CHECK(try_catch.HasCaught()); |
| 12562 v8::Handle<v8::Message> message = try_catch.Message(); |
| 12563 CHECK_EQ(1, message->GetLineNumber()); |
| 12564 CHECK_EQ(0, message->GetStartColumn()); |
| 12565 } |
| 12566 |
| 12567 |
12556 THREADED_TEST(CompilationCache) { | 12568 THREADED_TEST(CompilationCache) { |
12557 LocalContext context; | 12569 LocalContext context; |
12558 v8::HandleScope scope(context->GetIsolate()); | 12570 v8::HandleScope scope(context->GetIsolate()); |
12559 v8::Handle<v8::String> source0 = | 12571 v8::Handle<v8::String> source0 = |
12560 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); | 12572 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); |
12561 v8::Handle<v8::String> source1 = | 12573 v8::Handle<v8::String> source1 = |
12562 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); | 12574 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); |
12563 v8::Handle<v8::Script> script0 = CompileWithOrigin(source0, "test.js"); | 12575 v8::Handle<v8::Script> script0 = CompileWithOrigin(source0, "test.js"); |
12564 v8::Handle<v8::Script> script1 = CompileWithOrigin(source1, "test.js"); | 12576 v8::Handle<v8::Script> script1 = CompileWithOrigin(source1, "test.js"); |
12565 v8::Handle<v8::Script> script2 = | 12577 v8::Handle<v8::Script> script2 = |
(...skipping 8406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20972 | 20984 |
20973 { | 20985 { |
20974 v8::HandleScope handle_scope(isolate); | 20986 v8::HandleScope handle_scope(isolate); |
20975 | 20987 |
20976 // Should work | 20988 // Should work |
20977 v8::Local<v8::Object> obj = v8::Object::New(isolate); | 20989 v8::Local<v8::Object> obj = v8::Object::New(isolate); |
20978 | 20990 |
20979 USE(obj); | 20991 USE(obj); |
20980 } | 20992 } |
20981 } | 20993 } |
OLD | NEW |