Open
Bug 905450
Opened 12 years ago
Updated 3 years ago
Blackbox individual functions
Categories
(DevTools :: Debugger, enhancement, P3)
Tracking
(Not tracked)
NEW
People
(Reporter: fitzgen, Unassigned)
References
(Blocks 1 open bug)
Details
Sometimes you don't want to blackbox a whole source, but just a specific function. We could do something like
function someFunc() {
// ... do stuff somehow, we don't care it's a black box ...
}
someFunc.blackbox = true;
and someFunc would be considered black boxed.
Question: is it only the assigned function, or does this propagate like strict mode does? Would be fairly easy to implement either way (just walk the env chain for the latter option).
Reporter | ||
Updated•12 years ago
|
Blocks: dbg-blackbox
Comment 1•12 years ago
|
||
I would think function only since it's easy enough to propagate down manually (with extra annotations) but not so easy to go the other way.
Comment 2•12 years ago
|
||
I would think function only since it's easy enough to propagate down manually (with extra annotations) but not so easy to go the other way.
Comment 3•12 years ago
|
||
While it's true that inheriting by scope would be more difficult to override (impossible without serious source rewriting really), I also think it's the common use case. Perhaps a compromise can be made, by having the value be an enumeration rather than a boolean? Something like:
> func.blackbox = "self"
> func.blackbox = "children"
> func.blackbox = "cascading"
Or whatever bikeshedding the names comes up with.
Also I'd recommend making it into a more obscure property, with the goal of eventually transitioning to using a Symbol when they become available in SpiderMonkey. "@blackbox" for now or something otherwise unlikely to accidentally ever be used.
Reporter | ||
Comment 4•12 years ago
|
||
(In reply to Brandon Benvie [:bbenvie] from comment #3)
> While it's true that inheriting by scope would be more difficult to override
> (impossible without serious source rewriting really), I also think it's the
> common use case. Perhaps a compromise can be made, by having the value be an
> enumeration rather than a boolean? Something like:
>
> > func.blackbox = "self"
> > func.blackbox = "children"
> > func.blackbox = "cascading"
Great idea :)
"self" would be only fun
"cascading" would be like strict mode
"children" would be not func, but all of func's children?
Is that correct? "children" seems off to me... I'm not a fan, but could be convinced otherwise.
> Also I'd recommend making it into a more obscure property, with the goal of
> eventually transitioning to using a Symbol when they become available in
> SpiderMonkey. "@blackbox" for now or something otherwise unlikely to
> accidentally ever be used.
Another great idea. +1
Comment 5•12 years ago
|
||
(In reply to Nick Fitzgerald [:fitzgen] from comment #4)
> "self" would be only fun
> "cascading" would be like strict mode
> "children" would be not func, but all of func's children?
>
> Is that correct? "children" seems off to me... I'm not a fan, but could be
> convinced otherwise.
That is correct. I'm not too sure on it either, I'd probably lean toward just "self" and "cascading". I dislike the name "cascading" though, but couldn't think of a better word for "self+children".
Comment 6•12 years ago
|
||
And actually it's not "self+children" but "self+all functions inside". Maybe just "self" and "cascade".
Reporter | ||
Updated•12 years ago
|
Priority: -- → P3
Updated•11 years ago
|
Blocks: minotaur-kanban
Component: Developer Tools: Debugger → Developer Tools: User Stories
Updated•11 years ago
|
Summary: add ability to black box specific functions rather than whole sources → Blackbox individual functions
Component: Developer Tools: User Stories → Developer Tools: Debugger
Updated•7 years ago
|
Product: Firefox → DevTools
Updated•6 years ago
|
Type: defect → enhancement
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•