Closed Bug 415076 Opened 16 years ago Closed 5 years ago

Allow host objects to be notified of properties not found in prototypes chain

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: mguillemot, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11
Build Identifier: 

It is quite uneasy for an host object to have "low priority" properties, that should be returned only if no property with the given name is defined in the prototype chain.

In htmlunit we place for this purpose a custom object as prototype of Object. This custom object then calls getWithFallback() on our start object (when it makes sense). This allows us to simply handle this low priority properties but this implementation isn't totally hidden for the scripts as we've modified what should be the root prototype.

Provided patch adds a getWithFallback(String) method on ScriptableObject that returns NOT_FOUND per default. This method gets called if no property has been found in the prototype chain.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.

Closing. Bug management is now done here:
https://github.com/mozilla/rhino

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: