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

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

Issue 1121833003: [V8] Reland https://codereview.chromium.org/1100993003/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/scanner.cc ('k') | no next file » | 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 12547 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
12568 THREADED_TEST(CompilationCache) { 12580 THREADED_TEST(CompilationCache) {
12569 LocalContext context; 12581 LocalContext context;
12570 v8::HandleScope scope(context->GetIsolate()); 12582 v8::HandleScope scope(context->GetIsolate());
12571 v8::Handle<v8::String> source0 = 12583 v8::Handle<v8::String> source0 =
12572 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); 12584 v8::String::NewFromUtf8(context->GetIsolate(), "1234");
12573 v8::Handle<v8::String> source1 = 12585 v8::Handle<v8::String> source1 =
12574 v8::String::NewFromUtf8(context->GetIsolate(), "1234"); 12586 v8::String::NewFromUtf8(context->GetIsolate(), "1234");
12575 v8::Handle<v8::Script> script0 = CompileWithOrigin(source0, "test.js"); 12587 v8::Handle<v8::Script> script0 = CompileWithOrigin(source0, "test.js");
12576 v8::Handle<v8::Script> script1 = CompileWithOrigin(source1, "test.js"); 12588 v8::Handle<v8::Script> script1 = CompileWithOrigin(source1, "test.js");
12577 v8::Handle<v8::Script> script2 = 12589 v8::Handle<v8::Script> script2 =
(...skipping 8427 matching lines...) Expand 10 before | Expand all | Expand 10 after
21005 21017
21006 { 21018 {
21007 v8::HandleScope handle_scope(isolate); 21019 v8::HandleScope handle_scope(isolate);
21008 21020
21009 // Should work 21021 // Should work
21010 v8::Local<v8::Object> obj = v8::Object::New(isolate); 21022 v8::Local<v8::Object> obj = v8::Object::New(isolate);
21011 21023
21012 USE(obj); 21024 USE(obj);
21013 } 21025 }
21014 } 21026 }
OLDNEW
« no previous file with comments | « src/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698