| 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 12547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12558 | 12558 |
| 12559 resource_name = "test2.js"; | 12559 resource_name = "test2.js"; |
| 12560 v8::ScriptOrigin origin2( | 12560 v8::ScriptOrigin origin2( |
| 12561 v8::String::NewFromUtf8(context->GetIsolate(), resource_name), | 12561 v8::String::NewFromUtf8(context->GetIsolate(), resource_name), |
| 12562 v8::Integer::New(context->GetIsolate(), 7)); | 12562 v8::Integer::New(context->GetIsolate(), 7)); |
| 12563 script = v8::Script::Compile(source, &origin2); | 12563 script = v8::Script::Compile(source, &origin2); |
| 12564 CheckTryCatchSourceInfo(script, resource_name, 7); | 12564 CheckTryCatchSourceInfo(script, resource_name, 7); |
| 12565 } | 12565 } |
| 12566 | 12566 |
| 12567 | 12567 |
| 12568 THREADED_TEST(TryCatchSourceInfoForEOSError) { | |
| 12569 LocalContext context; | |
| 12570 v8::HandleScope scope(context->GetIsolate()); | |
| 12571 v8::TryCatch try_catch; | |
| 12572 v8::Script::Compile(v8_str("!\n")); | |
| 12573 CHECK(try_catch.HasCaught()); | |
| 12574 v8::Handle<v8::Message> message = try_catch.Message(); | |
| 12575 CHECK_EQ(1, message->GetLineNumber()); | |
| 12576 CHECK_EQ(0, message->GetStartColumn()); | |
| 12577 } | |
| 12578 | |
| 12579 | |
| 12580 THREADED_TEST(CompilationCache) { | 12568 THREADED_TEST(CompilationCache) { |
| 12581 LocalContext context; | 12569 LocalContext context; |
| 12582 v8::HandleScope scope(context->GetIsolate()); | 12570 v8::HandleScope scope(context->GetIsolate()); |
| 12583 v8::Handle<v8::String> source0 = | 12571 v8::Handle<v8::String> source0 = |
| 12584 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); | 12572 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); |
| 12585 v8::Handle<v8::String> source1 = | 12573 v8::Handle<v8::String> source1 = |
| 12586 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); | 12574 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); |
| 12587 v8::Handle<v8::Script> script0 = CompileWithOrigin(source0, "test.js"); | 12575 v8::Handle<v8::Script> script0 = CompileWithOrigin(source0, "test.js"); |
| 12588 v8::Handle<v8::Script> script1 = CompileWithOrigin(source1, "test.js"); | 12576 v8::Handle<v8::Script> script1 = CompileWithOrigin(source1, "test.js"); |
| 12589 v8::Handle<v8::Script> script2 = | 12577 v8::Handle<v8::Script> script2 = |
| (...skipping 8427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21017 | 21005 |
| 21018 { | 21006 { |
| 21019 v8::HandleScope handle_scope(isolate); | 21007 v8::HandleScope handle_scope(isolate); |
| 21020 | 21008 |
| 21021 // Should work | 21009 // Should work |
| 21022 v8::Local<v8::Object> obj = v8::Object::New(isolate); | 21010 v8::Local<v8::Object> obj = v8::Object::New(isolate); |
| 21023 | 21011 |
| 21024 USE(obj); | 21012 USE(obj); |
| 21025 } | 21013 } |
| 21026 } | 21014 } |
| OLD | NEW |