Closed Bug 71639 Opened 24 years ago Closed 23 years ago

Defining a getter does not work

Categories

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

defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 83433
mozilla1.0

People

(Reporter: erik, Assigned: jst)

Details

(Whiteboard: [XPCDOM])

Attachments

(1 file)

I'm trying to define a getter on the prototype of HTMLElement but the getter is 
never (well sometimes, ~1/10 tries) added.

HTMLElement.prototype.__defineGetter__("all", function () {
   return "Wow it worked this time";
});

And then

alert(document.body.all)

gives undefined.

Using: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; 0.8.1) Gecko/20010310
I made some tests with a user defined object and with the Date object and 
getters worked as expected. So it seems there is a problem with assigning 
getters to DOM objects.
This is jst's bug.  We discussed this a few weeks ago, as I recall.
Assignee: rogerl → jst
Component: Javascript Engine → DOM Other
What's going wrong, in brief?  Maybe I could help hack a fix?

/be
Setting to mozilla1.0 for now, I bet this will change (for better or worse) once
the DOM uses XPConnect.
OS: Windows 2000 → All
Hardware: PC → All
Whiteboard: [XPCDOM]
Target Milestone: --- → mozilla1.0
Component: DOM Other → DOM Level 1

*** This bug has been marked as a duplicate of 83433 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Verified Duplicate - 
Status: RESOLVED → VERIFIED
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: