Change "notDebuggee: cannot access the environment of this function." warning when inspecting function

NEW
Unassigned

Status

()

Firefox
Developer Tools: Debugger
P3
normal
4 years ago
3 years ago

People

(Reporter: benvie, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
Steps to reproduce:

1.) Open browser debugger
2.) Open webconsole
3.) Type "Function" into webconsole and click on it

You'll see "notDebuggee: cannot access the environment of this function." in the browser debugger.
(Reporter)

Comment 1

4 years ago
Sorry, open browser console.
This is just an informational warning, do you think we should silence those? I thought they might be useful to explain why you can't inspect the closure in the console or scratchpad when the debugger isn't active.
(Reporter)

Comment 3

4 years ago
Well, for every other built in function that doesn't have a closure, we just don't display <Closure>. We do for Function.prototype for some reason, which I assume is the reason this error comes up. We probably should just not show <Closure> for Function.prototype (not sure why we do now).
I don't believe we do anything special for "Function" in this case, it's just that the engine has associated a closure with it. The message comes from this line, which I added just to make sure this would not go unnoticed:

http://mxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/VariablesViewController.jsm#187

Removing this line (and the Cosnole.jsm import) will remove the warning, without any other ill effects.

Jim said that we should maybe modify the web console to always add the page global as a debuggee, which would make sure this error would never happen again, which could also be another approach here. It's not going to be as simple or happen as fast as the other option of course.
Priority: -- → P3

Updated

3 years ago
Summary: "notDebuggee: cannot access the environment of this function." when inspecting Function → Change "notDebuggee: cannot access the environment of this function." warning when inspecting function
You need to log in before you can comment on or make changes to this bug.