Summary: | JavaScript Debugger doesn't play nice with functions created with eval/(new Function()) | ||
---|---|---|---|
Product: | WebKit | Reporter: | boucher <rboucher> |
Component: | Web Inspector (Deprecated) | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | aroben, burg, emacemac7, ggaren, kmccullough, pmuellr, tom |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://280slides.com |
Description
boucher
2008-09-30 18:19:46 PDT
Just noticed, it also doesn't highlight the active line in source that's in "(program)" blocks when you're stepping through the debugger. No jumping and highlighting is just a bug. Names for eval would be nice. We do want to show something better than (program). I think perhaps using the first N characters of the first non empty line is a good (first attempt) proxy for a file name. This means that anyone formatting their code to include newlines can properly label the first line with a comment containing whatever they'd like displayed to the debugger. Non empty should be defined to exclude empty comment lines (in other words the first line to contain something more than just whitespace, //, /*, or *). Definitely no substitute for real naming, but perhaps something that would be easy enough to add in for the time being. Patch for supporting for naming evals via the Firefox convention of annotation comment is available in Bug 25475 . I modified fragment_evaluate_code() in Objective-J.js to append the relevant comment, and got all of the Function()'s named in the script drop-down, and I believe in the call stacks as well. The change was to augment the aFragment.info property like this, before using with the Function() constructor: aFragment.info += "\n//@sourceURL=" + aFragment.file.path + "\n"; |