Closed Bug 158475 Opened 22 years ago Closed 21 years ago

JS Console shouldn't remember previous execution state

Categories

(Core Graveyard :: Error Console, defect)

x86
Windows 98
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

Details

(Keywords: polish)

Attachments

(1 file)

Using Build ID: 2002071904 Expressions to evaluate to reproduce problem: 1. const b = false; b; 2. const b = true; b; 3. b; 4. b; Expected results: false, true, error, error Actual results: false, error, false, error
Attached patch Proposed patch (deleted) — Splinter Review
Keywords: patch, polish, review
Attachment #92096 - Flags: superreview?(bzbarsky)
Attachment #92096 - Flags: review?(timeless)
Comment on attachment 92096 [details] [diff] [review] Proposed patch I don't know how this code works and I don't think my review would mean anything. Please have someone familiar with this code review.
Attachment #92096 - Flags: superreview?(bzbarsky)
Attachment #92096 - Flags: superreview?(ben)
Attachment #92096 - Flags: review?(timeless)
Attachment #92096 - Flags: review+
Attachment #92096 - Flags: superreview?(ben) → superreview?(jaggernaut)
Hmm, not sure if this is the right fix. What's causing us to forget about |b| in this case? Why doesn't that kick in immediately? > var b = 3; b 3 > b 3 > b Error: b is not defined Btw, why should the JS console not remember its previous execution state? I've found that very useful in some cases. It would turn the JS console into a kind of js shell.
jag, what seems to happen is that the javascript: var b = 3; b creates a document where b is 3. The subsequent javscript: b evaluates b as 3 and creates a new document where b is undefined. Then the next javascript: b fails. Note that when javascript: statements don't have a result then they don't create a new document e.g. javascript: var b = 3; javascript: alert(b); javascript: alert(b); alerts 3 twice.
jag -- I think it's expected that the Console has no state. However, it would probably be useful to have the console have an option (perhaps as a menu option that could be checked) to remember its state. If that seems rational, I could file an RFE. Also, is that the correct QA contact for this bug? -M
Comment on attachment 92096 [details] [diff] [review] Proposed patch Since iframes now have attribute optimization you can't evaluate Math.random() etc. multiple times without this patch either.
Attachment #92096 - Flags: superreview?(jag) → superreview?(roc)
Comment on attachment 92096 [details] [diff] [review] Proposed patch OK ... but what do you mean by "attribute optimization"?
Attachment #92096 - Flags: superreview?(roc) → superreview+
Assignee: hewitt → neil.parkwaycc.co.uk
Whoops, checked this in two weeks ago :-[
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → SeaMonkey
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: