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

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

Issue 1648263002: [debugger] correctly find function context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 4 years, 10 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 | « src/contexts.cc ('k') | 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/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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 460
461 Handle<Context> frame_context(Context::cast(frame_inspector_->GetContext())); 461 Handle<Context> frame_context(Context::cast(frame_inspector_->GetContext()));
462 462
463 HandleScope scope(isolate_); 463 HandleScope scope(isolate_);
464 Handle<SharedFunctionInfo> shared(function->shared()); 464 Handle<SharedFunctionInfo> shared(function->shared());
465 Handle<ScopeInfo> scope_info(shared->scope_info()); 465 Handle<ScopeInfo> scope_info(shared->scope_info());
466 466
467 if (!scope_info->HasContext()) return local_scope; 467 if (!scope_info->HasContext()) return local_scope;
468 468
469 // Third fill all context locals. 469 // Third fill all context locals.
470 Handle<Context> function_context(frame_context->declaration_context()); 470 Handle<Context> function_context(frame_context->closure_context());
471 CopyContextLocalsToScopeObject(scope_info, function_context, local_scope); 471 CopyContextLocalsToScopeObject(scope_info, function_context, local_scope);
472 472
473 // Finally copy any properties from the function context extension. 473 // Finally copy any properties from the function context extension.
474 // These will be variables introduced by eval. 474 // These will be variables introduced by eval.
475 if (function_context->closure() == *function && 475 if (function_context->closure() == *function &&
476 function_context->has_extension() && 476 function_context->has_extension() &&
477 !function_context->IsNativeContext()) { 477 !function_context->IsNativeContext()) {
478 bool success = CopyContextExtensionToScopeObject( 478 bool success = CopyContextExtensionToScopeObject(
479 handle(function_context->extension_object(), isolate_), 479 handle(function_context->extension_object(), isolate_),
480 local_scope, JSReceiver::INCLUDE_PROTOS); 480 local_scope, JSReceiver::INCLUDE_PROTOS);
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 isolate_, value, Object::GetPropertyOrElement(extension, key), false); 812 isolate_, value, Object::GetPropertyOrElement(extension, key), false);
813 RETURN_ON_EXCEPTION_VALUE( 813 RETURN_ON_EXCEPTION_VALUE(
814 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( 814 isolate_, JSObject::SetOwnPropertyIgnoreAttributes(
815 scope_object, key, value, NONE), false); 815 scope_object, key, value, NONE), false);
816 } 816 }
817 return true; 817 return true;
818 } 818 }
819 819
820 } // namespace internal 820 } // namespace internal
821 } // namespace v8 821 } // namespace v8
OLDNEW
« no previous file with comments | « src/contexts.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698