Create result array of %DebugGetLoadedScripts outside the debug context.

R=jarin@chromium.org
BUG=chromium:474297
LOG=N

Review URL: https://codereview.chromium.org/1062143002

Cr-Commit-Position: refs/heads/master@{#27659}
This commit is contained in:
yangguo 2015-04-08 04:14:56 -07:00 committed by Commit bot
parent 2b59959c71
commit 3a4d073f1d
2 changed files with 13 additions and 3 deletions

View File

@ -2338,9 +2338,12 @@ RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) {
HandleScope scope(isolate);
DCHECK(args.length() == 0);
DebugScope debug_scope(isolate->debug());
// Fill the script objects.
Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts();
Handle<FixedArray> instances;
{
DebugScope debug_scope(isolate->debug());
// Fill the script objects.
instances = isolate->debug()->GetLoadedScripts();
}
// Convert the script objects to proper JS objects.
for (int i = 0; i < instances->length(); i++) {

View File

@ -0,0 +1,7 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --gc-interval=33 --expose-gc --allow-natives-syntax
%DebugGetLoadedScripts();