spheredev / neosphere

A lightweight game engine and development platform using JavaScript for game coding, based on the original Sphere engine by Chad Austin but with a redesigned, modern API and brand-new command-line development tools.
http://www.spheredev.org/
Other
105 stars 15 forks source link

Add the ability to view closure variables in SSj and SSj Blue #101

Open fatcerberus opened 7 years ago

fatcerberus commented 7 years ago

In minisphere 4.3.x and earlier, the SSJ v command (and by extension, the variable list in SSJ Blue) displays only direct local variables of a function. It would be nice if it would also list variables pulled in from parent scopes. At present debugging closures is somewhat painful because the closed-over variables aren't listed and must be examined individually using e or x.

This will almost certainly require a direct modification of Duktape debugger code, so also look into opening a pull request against @svaarala's repository once this is implemented.

fatcerberus commented 7 years ago

While I don't consider this a showstopper, I'd like to get this working for miniSphere 5.0 if at all possible.

fatcerberus commented 6 years ago

I think ChakraCore allows inspecting locals in parent scopes through its debugging API. So this would be possible to implement now; I'm not yet sure how much work it would entail. I'll leave the milestone as 5.0.0 until I've assessed that.

fatcerberus commented 6 years ago

Implementing this is not trivial, and involves implementing an entirely new SSj/Ki command along with the necessary plumbing in JSAL. Reassigning to 5.1.0.