I would say this is one of the places that Node shines, due to providing very easy to use access to the C++ API of V8 directly as JS modules. Straight copying and pasting from v8.h to a module that directly exposes the functions to JS can provide access to most of the tools one would want from JS that are out of JSland's reach normally. I slapped this together while playing around with it the other day https://gist.github.com/2837880.
On Wed, May 30, 2012 at 1:04 PM, John J Barton <[email protected]>wrote: > On Wed, May 30, 2012 at 12:45 AM, David Bruant <[email protected]> wrote: > > Le 29/05/2012 21:18, John J Barton a écrit : > > > >> On Tue, May 29, 2012 at 11:32 AM, Brendan Eich<[email protected]> > >> wrote: > >>> > >>> John J Barton wrote: > >>>> > >>>> This is one of those cases where a small delta creates a very large > >>>> negative effect. > >>> > >>> > >>> Evidence? > >> > >> If you look back on this thread you will see an example extracted from > >> the case that caused me pain. In the real life case I was using Kris > >> Kowal's Q_COMM library, which builds on Q and is quite sophisticated > >> code. > >> > >> I added a function to a Q_COMM object. Later when I called the > >> function I got an error. I had no idea that 'freeze' was involved. I > >> was mystified. > >> > >> For debugging I added a call as well as various tests for the function > >> existence immediately after I added the function. Then I wasted a lot > >> of time trying to create a test case to show the browser team that > >> they had a bug. Since I could not reproduce the problem I stepped > >> through Q_COMM code. Eventually I found this line > >> var defend = Object.freeze || noop; > >> > >> Anytime you have to debug library code it's a big negative effect. Is > >> there a way to debug this which is simple, given no strict nor > >> previous knowledge of freeze? > > > > As Brendan said, Object.isFrozen (or just Object.isExtensible) can do the > > trick. > > This assumes the developer expects a frozen object. Like I said, this > was the first time I encountered one. > > > > > > >> Devtools could have marked the object as froze, > >> https://code.google.com/p/chromium/issues/detail?id=130127 > > > > Devtools really are not ready for ES5 yet unfortunately. > > Let me use this comment to follow up on Claus' post as well. > > In my experience additions to development tools come from three forces: > 1) Personal interests. For example that is why I worked on eval > debugging and graphical breakpoints. > 2) Developer requests (newsgroups, bug reports, developer relations, > blogs, etc). For example that is how we got many of the features in > the Net panel of Firebug and Devtools. > 3) Organizational requests. For example, Google's large web apps > lead to better memory analysis tools. > > I'm not sure which features you are missing but (again in my > experience) the existence of a feature in the standard doesn't cause > devtools support absent one of the forces above. > > > > I've made a tool that visualize an object (then its prototype, then its > > prototype, etc.): http://davidbruant.github.com/ObjectViz/ > > You can visualize any object by going to the JavaScript console and > typing > > 'ObjectViz(yourObject)'. There is no legend, but color is for value type > > (white is getters/setters which are not called). There are visual codes > for > > non-configurable, non-writable or non-enumerable properties as well as > > non-extensible properties. I've had a lot of feedback of people telling > me > > it could be useful as a debugging tool. Currently, it takes way too much > > space and the code isn't packaged for that yet, but the idea is here. > > Chrome devtools has a good start on extensibility and this is area we > are expanding. Reach out on the devtools or jstools newsgroup if you > want help embedding ObjectViz. > > jjb > > > > > David > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

