Closed
Bug 466207
Opened 16 years ago
Closed 14 years ago
Implement java.util.List interface in NativeArray
Categories
(Rhino Graveyard :: Core, enhancement)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: hannesw, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
25.46 KB,
patch
|
Details | Diff | Splinter Review |
As proposed by Attila, JavaScript Arrays should implement the java.util.List interface like ScriptableObject implements java.util.Map (see bug 448816). This would make exchange of list-like date between JavaScript and Java in Rhino a breeze.
Reporter | ||
Comment 1•14 years ago
|
||
Turns out we can't make NativeArray implement java.util.List or even java.util.Collection since we made ScriptableObject implement java.util.Map with the patch for bug 448816, and Map has a remove(Object) method that is incompatible with that in List/Collection.
I think what we should do is move the Map implementation from ScriptableObject to NativeObject. Making JS-Object -> java.util.Map conversion work for native JS Objects should cover most use cases, and it's not obvious a Function or Date object should auto-convert to a Map. Not sure about custom Host objects, but these can always implement Map or subclass NativeObject.
I'm working on a patch, will post it shortly.
Status: NEW → ASSIGNED
Reporter | ||
Comment 2•14 years ago
|
||
As described in the previous comment, this moves the implementation of java.util.Map from ScriptableObject to NativeObject.
Reporter | ||
Comment 3•14 years ago
|
||
patch without the unrelated small optimization in NativeArray
Attachment #480945 -
Attachment is obsolete: true
Reporter | ||
Comment 4•14 years ago
|
||
I committed the last patch.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•