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

Side by Side Diff: src/debug/debug-scopes.cc

Issue 1290063002: Debugger: do not expose global object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months 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 | « no previous file | src/runtime/runtime-debug.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 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 DCHECK(context_->IsWithContext()); 222 DCHECK(context_->IsWithContext());
223 return ScopeTypeWith; 223 return ScopeTypeWith;
224 } 224 }
225 225
226 226
227 MaybeHandle<JSObject> ScopeIterator::ScopeObject() { 227 MaybeHandle<JSObject> ScopeIterator::ScopeObject() {
228 DCHECK(!failed_); 228 DCHECK(!failed_);
229 switch (Type()) { 229 switch (Type()) {
230 case ScopeIterator::ScopeTypeGlobal: 230 case ScopeIterator::ScopeTypeGlobal:
231 return Handle<JSObject>(CurrentContext()->global_object()); 231 return Handle<JSObject>(CurrentContext()->global_proxy());
232 case ScopeIterator::ScopeTypeScript: 232 case ScopeIterator::ScopeTypeScript:
233 return MaterializeScriptScope(); 233 return MaterializeScriptScope();
234 case ScopeIterator::ScopeTypeLocal: 234 case ScopeIterator::ScopeTypeLocal:
235 // Materialize the content of the local scope into a JSObject. 235 // Materialize the content of the local scope into a JSObject.
236 DCHECK(nested_scope_chain_.length() == 1); 236 DCHECK(nested_scope_chain_.length() == 1);
237 return MaterializeLocalScope(); 237 return MaterializeLocalScope();
238 case ScopeIterator::ScopeTypeWith: 238 case ScopeIterator::ScopeTypeWith:
239 // Return the with object. 239 // Return the with object.
240 return Handle<JSObject>(JSObject::cast(CurrentContext()->extension())); 240 return Handle<JSObject>(JSObject::cast(CurrentContext()->extension()));
241 case ScopeIterator::ScopeTypeCatch: 241 case ScopeIterator::ScopeTypeCatch:
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698