mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
LC3 support: make Java arrays have Array.prototype as a prototype.
This commit is contained in:
parent
d71fe13b62
commit
03c23c444d
@ -52,6 +52,21 @@ public class NativeJavaArray extends NativeJavaObject {
|
||||
this.array = array;
|
||||
this.length = Array.getLength(array);
|
||||
this.cls = cl.getComponentType();
|
||||
setPrototype(ScriptableObject.getClassPrototype(scope, "Array"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prototype of the object.
|
||||
*/
|
||||
public Scriptable getPrototype() {
|
||||
return prototype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the prototype of the object.
|
||||
*/
|
||||
public void setPrototype(Scriptable m) {
|
||||
prototype = m;
|
||||
}
|
||||
|
||||
public boolean has(String id, Scriptable start) {
|
||||
@ -118,4 +133,5 @@ public class NativeJavaArray extends NativeJavaObject {
|
||||
Object array;
|
||||
int length;
|
||||
Class cls;
|
||||
Scriptable prototype;
|
||||
}
|
||||
|
@ -52,6 +52,21 @@ public class NativeJavaArray extends NativeJavaObject {
|
||||
this.array = array;
|
||||
this.length = Array.getLength(array);
|
||||
this.cls = cl.getComponentType();
|
||||
setPrototype(ScriptableObject.getClassPrototype(scope, "Array"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prototype of the object.
|
||||
*/
|
||||
public Scriptable getPrototype() {
|
||||
return prototype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the prototype of the object.
|
||||
*/
|
||||
public void setPrototype(Scriptable m) {
|
||||
prototype = m;
|
||||
}
|
||||
|
||||
public boolean has(String id, Scriptable start) {
|
||||
@ -118,4 +133,5 @@ public class NativeJavaArray extends NativeJavaObject {
|
||||
Object array;
|
||||
int length;
|
||||
Class cls;
|
||||
Scriptable prototype;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user