OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/debug/debug-evaluate.h" | 5 #include "src/debug/debug-evaluate.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/debug/debug-frames.h" | 10 #include "src/debug/debug-frames.h" |
11 #include "src/debug/debug-scopes.h" | 11 #include "src/debug/debug-scopes.h" |
12 #include "src/isolate.h" | 12 #include "src/isolate.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 | |
18 static inline bool IsDebugContext(Isolate* isolate, Context* context) { | 17 static inline bool IsDebugContext(Isolate* isolate, Context* context) { |
19 // Try to unwrap script context if it exist. | 18 return context->native_context() == *isolate->debug()->debug_context(); |
20 if (context->IsScriptContext()) context = context->previous(); | |
21 DCHECK_NOT_NULL(context); | |
22 return context == *isolate->debug()->debug_context(); | |
23 } | 19 } |
24 | 20 |
25 | 21 |
26 MaybeHandle<Object> DebugEvaluate::Global(Isolate* isolate, | 22 MaybeHandle<Object> DebugEvaluate::Global(Isolate* isolate, |
27 Handle<String> source, | 23 Handle<String> source, |
28 bool disable_break, | 24 bool disable_break, |
29 Handle<Object> context_extension) { | 25 Handle<Object> context_extension) { |
30 // Handle the processing of break. | 26 // Handle the processing of break. |
31 DisableBreak disable_break_scope(isolate->debug(), disable_break); | 27 DisableBreak disable_break_scope(isolate->debug(), disable_break); |
32 | 28 |
(...skipping 275 matching lines...) Loading... |
308 // to materialize. | 304 // to materialize. |
309 return target; | 305 return target; |
310 } | 306 } |
311 | 307 |
312 return isolate_->factory()->NewCatchContext( | 308 return isolate_->factory()->NewCatchContext( |
313 function, target, isolate_->factory()->this_string(), receiver); | 309 function, target, isolate_->factory()->this_string(), receiver); |
314 } | 310 } |
315 | 311 |
316 } // namespace internal | 312 } // namespace internal |
317 } // namespace v8 | 313 } // namespace v8 |
OLD | NEW |