New issue
Advanced search Search tips

Issue 708845 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: console throws an error when text changes before console is shown

Project Member Reported by l...@chromium.org, Apr 6 2017

Issue description

What steps will reproduce the problem?
(1) Open DevTools without console ever becoming visible (have drawer open but not to console)
(2) Switch to console panel
(3) Open DevTools in DevTools and see the console error

Suspect: https://codereview.chromium.org/2565113002/

Guess is that ConsoleView's promptTextChanged callback is trying to get firstActiveIndex() before the first viewport.refresh().  This leads to viewport calling lowerBound(null, ...) which throws an error.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2d95267d052ef6af703663efd9fde7c3bb1730ba

commit 2d95267d052ef6af703663efd9fde7c3bb1730ba
Author: luoe <luoe@chromium.org>
Date: Mon Apr 10 18:24:33 2017

DevTools: make console viewport less error prone by always defining cumulativeHeights

ConsoleViewport's firstVisibleIndex() may throw an error if it calls
'lowerBound' while _cumulativeHeights is not defined. This scenario happens when
loading console after invalidating an empty viewport. Invalidate() deletes
_cumulativeHeights, the prompt text is changed, then firstVisibleIndex() is
called.

To make viewport's public functions less error prone, we can ensure that
_cumulativeHeights is always defined, using an empty typed array by default.

BUG= 708845 

Review-Url: https://codereview.chromium.org/2799043006
Cr-Commit-Position: refs/heads/master@{#463333}

[modify] https://crrev.com/2d95267d052ef6af703663efd9fde7c3bb1730ba/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js

Comment 2 by l...@chromium.org, Apr 26 2017

Status: Fixed (was: Assigned)

Sign in to add a comment