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/debug/debug.h" | 7 #include "src/debug/debug.h" |
8 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/parser.h" | 10 #include "src/parser.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Global or eval code. | 90 // Global or eval code. |
91 ParseInfo info(&zone, script); | 91 ParseInfo info(&zone, script); |
92 if (scope_info->scope_type() == SCRIPT_SCOPE) { | 92 if (scope_info->scope_type() == SCRIPT_SCOPE) { |
93 info.set_global(); | 93 info.set_global(); |
94 } else { | 94 } else { |
95 DCHECK(scope_info->scope_type() == EVAL_SCOPE); | 95 DCHECK(scope_info->scope_type() == EVAL_SCOPE); |
96 info.set_eval(); | 96 info.set_eval(); |
97 info.set_context(Handle<Context>(function->context())); | 97 info.set_context(Handle<Context>(function->context())); |
98 } | 98 } |
99 if (Parser::ParseStatic(&info) && Scope::Analyze(&info)) { | 99 if (Parser::ParseStatic(&info) && Scope::Analyze(&info)) { |
100 scope = info.function()->scope(); | 100 scope = info.literal()->scope(); |
101 } | 101 } |
102 RetrieveScopeChain(scope, shared_info); | 102 RetrieveScopeChain(scope, shared_info); |
103 } else { | 103 } else { |
104 // Function code | 104 // Function code |
105 ParseInfo info(&zone, function); | 105 ParseInfo info(&zone, function); |
106 if (Parser::ParseStatic(&info) && Scope::Analyze(&info)) { | 106 if (Parser::ParseStatic(&info) && Scope::Analyze(&info)) { |
107 scope = info.function()->scope(); | 107 scope = info.literal()->scope(); |
108 } | 108 } |
109 RetrieveScopeChain(scope, shared_info); | 109 RetrieveScopeChain(scope, shared_info); |
110 } | 110 } |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 ScopeIterator::ScopeIterator(Isolate* isolate, Handle<JSFunction> function) | 115 ScopeIterator::ScopeIterator(Isolate* isolate, Handle<JSFunction> function) |
116 : isolate_(isolate), | 116 : isolate_(isolate), |
117 frame_inspector_(NULL), | 117 frame_inspector_(NULL), |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 // TODO(verwaest): Use AddDataProperty instead. | 760 // TODO(verwaest): Use AddDataProperty instead. |
761 JSObject::SetOwnPropertyIgnoreAttributes( | 761 JSObject::SetOwnPropertyIgnoreAttributes( |
762 scope_object, handle(String::cast(scope_info->get(i + start))), value, | 762 scope_object, handle(String::cast(scope_info->get(i + start))), value, |
763 ::NONE) | 763 ::NONE) |
764 .Check(); | 764 .Check(); |
765 } | 765 } |
766 } | 766 } |
767 | 767 |
768 } // namespace internal | 768 } // namespace internal |
769 } // namespace v8 | 769 } // namespace v8 |
OLD | NEW |