Closed Bug 651568 Opened 15 years ago Closed 13 years ago

Add an evalHook callback to jsdIDebuggerService

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: sfink, Assigned: sfink)

Details

Attachments

(4 files)

Forked from bug 645160. Right now it is very difficult to detect whether a script originated from an eval(), and even harder to get the original source code passed to an eval(). There should be a simple way to get both without requiring contortions in the JSD client. This was originally intended as a fix for bug 645160, but it turns out there's a more direct route to fixing that bug. (Maybe even simpler, though that remains to be seen. Certainly simpler from Firebug's point of view.) I am copying some patches over from that bug that have already been reviewed. I really wish bugzilla would allow me to move attachments around.
Assignee: nobody → sphink
r=jorendorff in bug 645160, with the following comment: Comment on attachment 527112 [details] [diff] [review] Part 2: Remember whether a script originated from an eval() Instead of bumping JSXDR_MAGIC_SCRIPT_CURRENT, I think the right thing is to bump JSXDR_BYTECODE_VERSION -- even though this is not a change to bytecode, per se. Brendan can tell us for sure. Other than that, this is fine.
Attachment #527330 - Flags: review+
Moved patch over from bug 645160. Brendan - in addition to this review, can you respond to jorendorff's comment on the other patch in this bug (see previous comment)?
Attachment #527331 - Flags: review?(brendan)
Attachment #528237 - Flags: review?(brendan)
Attachment #527329 - Attachment description: Part 1: add eval hook to debug hook set → Part 1: add eval hook to debug hook set (borrowed from bug 645150, r=luke)
Attachment #527330 - Attachment description: Part 2: Remember whether a script originated from an eval() → Part 2: Remember whether a script originated from an eval() (borrowed from bug 645160, r=jorendorff with suggestions)
IRC comment from jimb re part 1: <jimb> sfink: Is there a reason that the comment in jsscript.h in the "Part 2" patch says that the script is created by "toplevel eval()"? It seems to me that it could be any eval call, just looking at the code in EvalKernel that's setting TCF_COMPILE_FOR_EVAL (which is the ultimate source of your bit). sfink: Or by "toplevel eval", do you mean "code passed to eval that is not part of a function body"? sfink: The ES5 term for that is, simply, "eval code".
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
Attachment #527331 - Flags: review?(brendan)
Attachment #528237 - Flags: review?(brendan)
Nothing more is going to happen in this bug for JSD.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: