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

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

Issue 341082: Reverting 3174. Aka reapplying 3150, 3151 and 3159. Aka api accessor (Closed)
Patch Set: Created 11 years, 1 month 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 // Compile and run the supplied source and return the requested function. 172 // Compile and run the supplied source and return the requested function.
173 static v8::Local<v8::Function> CompileFunction(const char* source, 173 static v8::Local<v8::Function> CompileFunction(const char* source,
174 const char* function_name) { 174 const char* function_name) {
175 v8::Script::Compile(v8::String::New(source))->Run(); 175 v8::Script::Compile(v8::String::New(source))->Run();
176 return v8::Local<v8::Function>::Cast( 176 return v8::Local<v8::Function>::Cast(
177 v8::Context::GetCurrent()->Global()->Get(v8::String::New(function_name))); 177 v8::Context::GetCurrent()->Global()->Get(v8::String::New(function_name)));
178 } 178 }
179 179
180 180
181 // Helper function that compiles and runs the source.
182 static v8::Local<v8::Value> CompileRun(const char* source) {
183 return v8::Script::Compile(v8::String::New(source))->Run();
184 }
185
186
187 // Is there any debug info for the function? 181 // Is there any debug info for the function?
188 static bool HasDebugInfo(v8::Handle<v8::Function> fun) { 182 static bool HasDebugInfo(v8::Handle<v8::Function> fun) {
189 Handle<v8::internal::JSFunction> f = v8::Utils::OpenHandle(*fun); 183 Handle<v8::internal::JSFunction> f = v8::Utils::OpenHandle(*fun);
190 Handle<v8::internal::SharedFunctionInfo> shared(f->shared()); 184 Handle<v8::internal::SharedFunctionInfo> shared(f->shared());
191 return Debug::HasDebugInfo(shared); 185 return Debug::HasDebugInfo(shared);
192 } 186 }
193 187
194 188
195 // Set a break point in a function and return the associated break point 189 // Set a break point in a function and return the associated break point
196 // number. 190 // number.
(...skipping 5240 matching lines...) Expand 10 before | Expand all | Expand 10 after
5437 v8::Script::New( 5431 v8::Script::New(
5438 v8::String::New( 5432 v8::String::New(
5439 "function runTest(mirror) {" 5433 "function runTest(mirror) {"
5440 " return mirror.isString() && (mirror.length() == 5);" 5434 " return mirror.isString() && (mirror.length() == 5);"
5441 "}" 5435 "}"
5442 "" 5436 ""
5443 "runTest;"))->Run()); 5437 "runTest;"))->Run());
5444 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); 5438 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj);
5445 CHECK(result->IsTrue()); 5439 CHECK(result->IsTrue());
5446 } 5440 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698