Java class wrapping not customizable via WrapFactory

RESOLVED FIXED

Status

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: hannesw, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
The WrapFactory class is supposed to provide an interface for customizing Java object wrapping, but Java classes (an important subset of java objects) are currently not passed through it. Instead, Java class wrapping is hard-coded to NativeJavaClass.
(Reporter)

Comment 1

8 years ago
Calling java classes a subset of java objects as I did above is nonsense of course. Still, being able to control class wrapper creation alongside object wrapper creation makes a lot of sense to me.
(Reporter)

Comment 2

8 years ago
Created attachment 497775 [details] [diff] [review]
Add wrapJavaClass() method to WrapFactory

Adds a wrapJavaClass() method to WrapFactory that returns a new NativeJavaClass. Replace all instances of NativeJavaClass instantiation with calls to WrapFactory.wrapJavaClass().
(Reporter)

Comment 3

8 years ago
I committed my patch.

Checking in src/org/mozilla/javascript/NativeJavaClass.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaClass.java,v  <--  NativeJavaClass.java
new revision: 1.56; previous revision: 1.55
done
Checking in src/org/mozilla/javascript/NativeJavaPackage.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaPackage.java,v  <--  NativeJavaPackage.java
new revision: 1.46; previous revision: 1.45
done
Checking in src/org/mozilla/javascript/WrapFactory.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/WrapFactory.java,v  <--  WrapFactory.java
new revision: 1.21; previous revision: 1.20
done
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.