The command line API in unavailable in the COnsole when paused in the debugger. Things like dir({x: 1}) and clear() fail.
Created attachment 23226 [details] proposed patch
Comment on attachment 23226 [details] proposed patch This patch is the right approach, but it will break printing of local variables. ANy local variables that shadow a window property, like document or alert, etc. will always print the window version and not the local version. We can't use the with statement when paused. So I am not sure how to fix this in JS alone. We might need to modify evaluateInSelectedCallFrame to take an object that it adds to the bottom of the scope chain, so local variables are found first.
*** Bug 21617 has been marked as a duplicate of this bug. ***
dir({x: 1}) and clear() work for me on ToT (r66819)