LC3 support: make Java arrays have Array.prototype as a prototype.

This commit is contained in:
norris%netscape.com 1999-06-03 23:38:47 +00:00
parent d71fe13b62
commit 03c23c444d
2 changed files with 32 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}