New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 668242 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 29 days ago
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

DevTools: breakpoints in sourcemap source throw exception

Project Member Reported by lushnikov@chromium.org, Nov 23 2016

Issue description

My version: tip-of-tree from morning of November 23, 2016. Chrome 57.0.2930.0

Step-by-step:

1. Load a website with devtools and javascript sourcemap
   1.1. Fox example: git clone https://github.com/samccone/grifter
   1.2. cd grifter
   1.3. npm run watch (to build everything)
   1.4. ctrl^c
   1.5. python -m SimpleHTTPServer 8000

2. navigate chrome to localhost:8000
3. open devtools -> sources -> index.ts
4. set breakpoint on line 19
5. reload page

Here's the stack I get: 

Uncaught (in promise) TypeError: Cannot read property 'parent' of undefined
    at lineNo (codemirror.js:7852)
    at CodeMirror.Doc.getLineNumber (codemirror.js:7479)
    at CodeMirror.eval [as getLineNumber] (codemirror.js:7774)
    at TextEditor.CodeMirrorPositionHandle.resolve (CodeMirrorTextEditor.js:1306)
    at Sources.JavaScriptSourceFrame.update (JavaScriptSourceFrame.js:756)
    at runInOp (codemirror.js:3204)
    at CodeMirror.operation (codemirror.js:5335)
    at SourceFrame.SourcesTextEditor.operation (CodeMirrorTextEditor.js:740)
    at setImmediate (JavaScriptSourceFrame.js:746)
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 23 2016

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

commit b33d093abe57100f572b4901dbcfac5d5489f121
Author: lushnikov <lushnikov@chromium.org>
Date: Wed Nov 23 22:01:12 2016

DevTools: fix exception when setting a breakpoint in sourcemap source

The following scenario takes place on reload:
1. The breakpoint gets hit in dist.js
2. The dist.js has a sourceMap which is not yet loaded. For this reason,
   stubs are created for the sourcemaps sources. SourceMapping gets changed
   to actually point to the stub
3. The execution line gets revealed in the stub
4. JavaScriptSourceFrame attempts to put a breakpoint in a stub. However,
   since the stub is just a few lines of text, there's no linehandle for the
   breakpoint linenumber.

This is essentially an issue inside TextPositionPositionHandle.

BUG= 668242 
TBR=kozyatinskiy, dgozman

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

[modify] https://crrev.com/b33d093abe57100f572b4901dbcfac5d5489f121/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js

Status: Fixed (was: Assigned)

Sign in to add a comment