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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 v8::Local<v8::Object> global = isolate->GetCurrentContext()->Global(); | 148 v8::Local<v8::Object> global = isolate->GetCurrentContext()->Global(); |
149 return v8::Local<v8::Function>::Cast( | 149 return v8::Local<v8::Function>::Cast( |
150 global->Get(v8::String::NewFromUtf8(isolate, function_name))); | 150 global->Get(v8::String::NewFromUtf8(isolate, function_name))); |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 // Is there any debug info for the function? | 154 // Is there any debug info for the function? |
155 static bool HasDebugInfo(v8::Handle<v8::Function> fun) { | 155 static bool HasDebugInfo(v8::Handle<v8::Function> fun) { |
156 Handle<v8::internal::JSFunction> f = v8::Utils::OpenHandle(*fun); | 156 Handle<v8::internal::JSFunction> f = v8::Utils::OpenHandle(*fun); |
157 Handle<v8::internal::SharedFunctionInfo> shared(f->shared()); | 157 Handle<v8::internal::SharedFunctionInfo> shared(f->shared()); |
158 return Debug::HasDebugInfo(shared); | 158 return shared->HasDebugInfo(); |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 // Set a break point in a function and return the associated break point | 162 // Set a break point in a function and return the associated break point |
163 // number. | 163 // number. |
164 static int SetBreakPoint(Handle<v8::internal::JSFunction> fun, int position) { | 164 static int SetBreakPoint(Handle<v8::internal::JSFunction> fun, int position) { |
165 static int break_point = 0; | 165 static int break_point = 0; |
166 v8::internal::Isolate* isolate = fun->GetIsolate(); | 166 v8::internal::Isolate* isolate = fun->GetIsolate(); |
167 v8::internal::Debug* debug = isolate->debug(); | 167 v8::internal::Debug* debug = isolate->debug(); |
168 debug->SetBreakPoint( | 168 debug->SetBreakPoint( |
(...skipping 7403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7572 "let y = 2; \n" | 7572 "let y = 2; \n" |
7573 "debugger; \n" | 7573 "debugger; \n" |
7574 "x * y", | 7574 "x * y", |
7575 30); | 7575 30); |
7576 ExpectInt32( | 7576 ExpectInt32( |
7577 "x = 1; y = 2; \n" | 7577 "x = 1; y = 2; \n" |
7578 "debugger;" | 7578 "debugger;" |
7579 "x * y", | 7579 "x * y", |
7580 30); | 7580 30); |
7581 } | 7581 } |
OLD | NEW |