| 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-scopes.h" | 5 #include "src/debug/debug-scopes.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 isolate_, value, Object::GetPropertyOrElement(extension, key), false); | 835 isolate_, value, Object::GetPropertyOrElement(extension, key), false); |
| 836 RETURN_ON_EXCEPTION_VALUE( | 836 RETURN_ON_EXCEPTION_VALUE( |
| 837 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( | 837 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( |
| 838 scope_object, key, value, NONE), false); | 838 scope_object, key, value, NONE), false); |
| 839 } | 839 } |
| 840 return true; | 840 return true; |
| 841 } | 841 } |
| 842 | 842 |
| 843 void ScopeIterator::GetNestedScopeChain(Isolate* isolate, Scope* scope, | 843 void ScopeIterator::GetNestedScopeChain(Isolate* isolate, Scope* scope, |
| 844 int position) { | 844 int position) { |
| 845 if (!scope->is_eval_scope()) { | 845 if (!scope->is_eval_scope() && !scope->is_hidden()) { |
| 846 nested_scope_chain_.Add(ExtendedScopeInfo(scope->GetScopeInfo(isolate), | 846 nested_scope_chain_.Add(ExtendedScopeInfo(scope->GetScopeInfo(isolate), |
| 847 scope->start_position(), | 847 scope->start_position(), |
| 848 scope->end_position())); | 848 scope->end_position())); |
| 849 } | 849 } |
| 850 for (int i = 0; i < scope->inner_scopes()->length(); i++) { | 850 for (int i = 0; i < scope->inner_scopes()->length(); i++) { |
| 851 Scope* inner_scope = scope->inner_scopes()->at(i); | 851 Scope* inner_scope = scope->inner_scopes()->at(i); |
| 852 int beg_pos = inner_scope->start_position(); | 852 int beg_pos = inner_scope->start_position(); |
| 853 int end_pos = inner_scope->end_position(); | 853 int end_pos = inner_scope->end_position(); |
| 854 DCHECK(beg_pos >= 0 && end_pos >= 0); | 854 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); |
| 855 if (beg_pos <= position && position < end_pos) { | 855 if (beg_pos <= position && position < end_pos) { |
| 856 GetNestedScopeChain(isolate, inner_scope, position); | 856 GetNestedScopeChain(isolate, inner_scope, position); |
| 857 return; | 857 return; |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 } | 860 } |
| 861 | 861 |
| 862 } // namespace internal | 862 } // namespace internal |
| 863 } // namespace v8 | 863 } // namespace v8 |
| OLD | NEW |