Closed Bug 47402 Opened 25 years ago Closed 25 years ago

Javascript crashes browser on incorrect method reassignment to base classes

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

VERIFIED DUPLICATE of bug 33304

People

(Reporter: hand, Assigned: rogerl)

Details

(Keywords: crash)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) BuildID: 200072920 It assumes that the node is a Document where that may not necessarily be true and tries to call its getElementById method which it does not have. Reproducible: Always Steps to Reproduce: 1. Do the following assignment where TypeA and TypeB are built in types. TypeA.prototype.oldMethod = TypeB.prototype.method 2. Call oldMethod of an object of TypeA that is not also of TypeB 3. Run the javascript Actual Results: Crash! Expected Results: It should provide a sensible error message. One possibility is to prevent the assignment in the first place. (Which is good for catching errors - but loses some functionality that I find use for) The best option is to display a Javascript error when the attempt to call a non- existant method occurs.
Confirmed on linux 2000080108. Changing OS/Plat to all. It gives me an XUL alert before crashing. Adding crash keyword.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: crash
OS: Windows NT → All
Hardware: PC → All
It seems likely to me that this is a bug in the DOM's reflection objects and not in the JS engine.
The XUL alert is to demonstrate that the javascript has started executing before mozilla crashes and show the success of the original method call.
Indeed, this is a dup of one of jst's bugs. /be *** This bug has been marked as a duplicate of 33304 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Verifying duplicate -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: