Can't resolve "this" pointer in DevTools |
||
Issue descriptionChromium 72.0.3597.0 (Developer Build) (32-bit) Revision d2896e776895c7f89af2239019676859c5ae8686-refs/heads/master@{#604072} OS: Windows 10 What steps will reproduce the problem? (1) Navigate to https://s3-eu-west-1.amazonaws.com/bug-demo/google.html (from Issue 894021 ) (2) Open DevTools (3) Go to Sources tab (4) Navigate to the following path (see attached screenshot): webpack:// (blank) Users/danielmanson/Mapbox-vector-tiles-basic-js-renderer src basic renderer.js (5) Set a breakpoint on line 401: c.ctx.drawImage(this._canvas, srcLeft, srcTop, width, height, destLeft, destTop, width, height); (6) Pan the map around until the breakpoint is hit (7) Attempt to type "this" in the DevTools console What is the expected result? Expect to be able to programmatically inspect "this", in particular "this._canvas". What happens instead? "this" is undefined in scope. Can inspect other local variables both by hovering over them and typing their names into the console, and can also see properties of "this._canvas" by hovering over it in the source view; but it's not possible to type imperative code into the console which operates upon "this". This is preventing effective debugging of this bug. Please diagnose; thanks.
,
Nov 2
When I click on any higher callframe (_loop2, _loop, and the top-level . (anonymous)), evaluating 'this' in the console shelf still results in 'undefined'.
,
Nov 2
In an offline discussion, we found the true issue. The file shown is a sourcemapped version of the script that is actually evaluated. The evaluated script does not have `this` in its source code, but rather `_this10`, some name likely generated by Webpack. I'll take a look. There should be something smart we can do with Console autocomplete / Object popup previews to make it more intuitive.
,
Nov 15
|
||
►
Sign in to add a comment |
||
Comment 1 by l...@chromium.org
, Oct 31Owner: yangguo@chromium.org
Status: Assigned (was: Untriaged)