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

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

Issue 1916413002: [debugger] fix crash in debug-evaluate when retrieving values in TDZ. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: fix test Created 4 years, 8 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 | « include/v8-version.h ('k') | test/mjsunit/regress/regress-crbug-605581.js » ('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-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"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 for (const Handle<String>& name : non_locals_) { 339 for (const Handle<String>& name : non_locals_) {
340 HandleScope scope(isolate_); 340 HandleScope scope(isolate_);
341 Handle<Object> value; 341 Handle<Object> value;
342 bool global; 342 bool global;
343 if (!LoadFromContext(context, name, &global).ToHandle(&value) || global) { 343 if (!LoadFromContext(context, name, &global).ToHandle(&value) || global) {
344 // If resolving the variable fails, skip it. If it resolves to a global 344 // If resolving the variable fails, skip it. If it resolves to a global
345 // variable, skip it as well since it's not read-only and can be resolved 345 // variable, skip it as well since it's not read-only and can be resolved
346 // within debug-evaluate. 346 // within debug-evaluate.
347 continue; 347 continue;
348 } 348 }
349 if (value->IsTheHole()) continue; // Value is not initialized yet (in TDZ).
349 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); 350 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check();
350 } 351 }
351 } 352 }
352 353
353 354
354 void DebugEvaluate::ContextBuilder::StoreToContext(Handle<Context> context, 355 void DebugEvaluate::ContextBuilder::StoreToContext(Handle<Context> context,
355 Handle<String> name, 356 Handle<String> name,
356 Handle<Object> value) { 357 Handle<Object> value) {
357 static const ContextLookupFlags flags = FOLLOW_CONTEXT_CHAIN; 358 static const ContextLookupFlags flags = FOLLOW_CONTEXT_CHAIN;
358 int index; 359 int index;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 LoadFromContext(lookup_context, this_string, &global).ToHandle(&receiver); 398 LoadFromContext(lookup_context, this_string, &global).ToHandle(&receiver);
398 } else if (local_function->shared()->scope_info()->HasReceiver()) { 399 } else if (local_function->shared()->scope_info()->HasReceiver()) {
399 receiver = handle(frame_->receiver(), isolate_); 400 receiver = handle(frame_->receiver(), isolate_);
400 } 401 }
401 return isolate_->factory()->NewCatchContext(global_function, parent_context, 402 return isolate_->factory()->NewCatchContext(global_function, parent_context,
402 this_string, receiver); 403 this_string, receiver);
403 } 404 }
404 405
405 } // namespace internal 406 } // namespace internal
406 } // namespace v8 407 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | test/mjsunit/regress/regress-crbug-605581.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698