Closed Bug 343596 Opened 19 years ago Closed 19 years ago

setTimeout doesn't work after setting script node's text to a script that causes an error

Categories

(Core :: DOM: Core & HTML, defect, P2)

PowerPC
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: jruderman, Assigned: mrbkap)

References

Details

(Keywords: fixed1.8.1, testcase)

Attachments

(2 files)

Steps to reproduce: 1. Load the testcase. Expected: alert saying "PASS" Result: no alert I'm using a Mac debug build from within the last few days.
Attached file testcase
This is because nested scripts aren't properly clearing pending exceptions off of their contexts.
Component: JavaScript Engine → DOM
Attached patch Proposed fixSplinter Review
The script loader code assumes that nsIScriptContext::EvaluateString will return an error code if there was an error evaluating the string. This isn't true, however, so we're not clearing the pending exception on cx and further js_Interprets on cx are bailing. This assumption doesn't usually bite us because in the common case, there's no code running on cx in nsJSContext::EvaluateString, so the JS engine reports the uncaught exception.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #228093 - Flags: review?(bzbarsky)
Blocks: js1.7
Priority: -- → P2
Target Milestone: --- → mozilla1.9alpha
QA Contact: general → ian
Attachment #228093 - Flags: review?(bzbarsky) → review?(jst)
Comment on attachment 228093 [details] [diff] [review] Proposed fix r+sr=jst
Attachment #228093 - Flags: superreview+
Attachment #228093 - Flags: review?(jst)
Attachment #228093 - Flags: review+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Is this needed for 1.8.1? (Will it be needed when JS1.7 lands there?)
Flags: blocking1.8.1?
Blocks: 343943
Flags: blocking1.8.1?
Keywords: fixed1.8.1
Checking in test_bug343596.html; /cvsroot/mozilla/testing/mochitest/tests/test_bug343596.html,v <-- test_bug343596.html initial revision: 1.1 done
Flags: in-testsuite+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: