Mucking about with stuff.
git-svn-id: svn://10.0.0.236/trunk@34891 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3,11 +3,12 @@ import java.util.Hashtable;
|
||||
|
||||
class JSObject extends JSValue {
|
||||
|
||||
static JSObject JSUndefined = new JSObject("undefined");
|
||||
static JSObject JSUndefined = new JSObject("undefined", null);
|
||||
|
||||
JSObject(String aValue)
|
||||
JSObject(String aValue, JSObject aPrototype)
|
||||
{
|
||||
value = aValue;
|
||||
prototype = aPrototype;
|
||||
}
|
||||
|
||||
String print(String indent)
|
||||
@@ -38,9 +39,17 @@ class JSObject extends JSValue {
|
||||
JSDouble toJSDouble(Environment theEnv) {
|
||||
return toPrimitive(theEnv, "Number").toJSDouble(theEnv);
|
||||
}
|
||||
|
||||
JSValue getProp(Environment theEnv, JSString id) {
|
||||
return (JSValue)(contents.get(id.s));
|
||||
|
||||
JSValue getProp(Environment theEnv, JSString id)
|
||||
{
|
||||
Object v = contents.get(id.s);
|
||||
if (v == null)
|
||||
if (prototype == null)
|
||||
return JSUndefined;
|
||||
else
|
||||
return prototype.getProp(theEnv, id);
|
||||
else
|
||||
return (JSValue)v;
|
||||
}
|
||||
|
||||
JSValue putProp(Environment theEnv, JSString id, JSValue rV) {
|
||||
@@ -53,4 +62,5 @@ class JSObject extends JSValue {
|
||||
|
||||
String value;
|
||||
|
||||
JSObject prototype;
|
||||
}
|
||||
Reference in New Issue
Block a user