Last Comment Bug 592552 - History is shared among all Web Console instances
: History is shared among all Web Console instances
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-31 18:03 PDT by Patrick Walton (:pcwalton)
Modified: 2012-01-20 01:26 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Patrick Walton (:pcwalton) 2010-08-31 18:03:09 PDT
Currently, the history is shared among all Web Console instances due to the fact that the actual history object is in a singleton array object in JSTerm.prototype. The *index* into the history, however, is unique to each console, which strikes me as potentially confusing.

This issue is making it difficult to split up the tests (bug 581069) because reinitializing the Web Console doesn't actually clear the history.
Comment 1 David Dahl :ddahl 2011-03-14 14:49:39 PDT
(In reply to comment #0)

> This issue is making it difficult to split up the tests (bug 581069) because
> reinitializing the Web Console doesn't actually clear the history.

The tests are split up now, so that is not an issue any more. as far as the shared history is concerned, I kind of like it as I tend to enter similar commands in the next console as the previous - its kind of like having bash_history. In which case is this still a bug? I don't think so. Ideas?
Comment 2 Mihai Sucan [:msucan] 2011-03-16 03:06:43 PDT
It's a matter of preference, actually. I wouldn't always like shared history. I expect Up to always give me back the last command I inputted in the given console - not from the other tab.
Comment 3 Rob Campbell [:rc] (:robcee) 2011-03-16 07:23:00 PDT
I think it's kind of confusing too. The console is very tab-specific right now. Having a shared command history across all consoles seems wrong to me. I don't think it's going to be very often that you'll want to run the same commands against different sites (though it might be useful if histories were associated to location or compartment).
Comment 4 Kevin Dangoor 2012-01-17 07:06:07 PST
as far as I can tell, this is fixed both for GCLI and the traditional JS command line
Comment 5 Jason Orendorff [:jorendorff] 2012-01-20 01:26:41 PST
But this line still occurs in 7 tests, and I just had to add it to a new one:

  jsterm.history.splice(0, jsterm.history.length);   // workaround for bug 592552

It seems like the functionality is as desired, but the tests are still undesirably crufty. Maybe this line of code should just appear in tearDown() in head.js rather than at the end of each test that needs it. (The same might apply to the clearOutput() call that seems to be in many tests.)

Note You need to log in before you can comment on or make changes to this bug.