// FIXME FIXME super ad-hoc
public void put(String name, Scriptable start, Object value) {
	    try {
		ObjectLocation variable = this.extractFieldVariable(name);
		if (value instanceof NativeArray) {
		    // FIXME this breaks referential equality, but maybe it's OK
		    variable.set(this.sequenceFromArray((NativeArray)value, start));
		    return;
		}
		//System.err.println("variable " + variable + " new value " + value + " type " + variable.getClass().getName());
		if (variable instanceof FloatLocation) { // FIXME FIXME super ad-hoc
		    value = Context.jsToJava(value, Float.class);
		} else if (value instanceof ObjectLocation) {
		    // here's a place where two locations could be bound to each other?
		    value = ((ObjectLocation)value).get();
		} else if (value instanceof Wrapper) {
		    // FIXME is there a better way???
		    value = ((Wrapper)value).unwrap();
		    if (value instanceof ObjectLocation) {
			value = ((ObjectLocation)value).get();
		    }
		}
		variable.set(value); 
		return;
	    } catch (Exception e) { 
		e.printStackTrace(System.err);
	    }
	}
}
//System.err.println("variable " + variable + " new value " + value + " type " + variable.getClass().getName());
if (variable instanceof FloatLocation) { // FIXME FIXME super ad-hoc
value = Context.jsToJava(value, Float.class);
} else if (value instanceof ObjectLocation) {
public void put(String name, Scriptable start, Object value) {
try {
ObjectLocation variable = this.extractFieldVariable(name);
if (value instanceof NativeArray) {
// FIXME this breaks referential equality, but maybe it's OK
variable.set(this.sequenceFromArray((NativeArray)value, start));
return;
}
//System.err.println("variable " + variable + " new value " + value + " type " + variable.getClass().getName());
if (variable instanceof FloatLocation) { // FIXME FIXME super ad-hoc
value = Context.jsToJava(value, Float.class);
} else if (value instanceof ObjectLocation) {
// here's a place where two locations could be bound to each other?
value = ((ObjectLocation)value).get();
} else if (value instanceof Wrapper) {
// FIXME is there a better way???
value = ((Wrapper)value).unwrap();
if (value instanceof ObjectLocation) {
value = ((ObjectLocation)value).get();
}
public void put(String name, Scriptable start, Object value) {
try {
ObjectLocation variable = this.extractFieldVariable(name);
if (value instanceof NativeArray) {
// FIXME this breaks referential equality, but maybe it's OK
variable.set(this.sequenceFromArray((NativeArray)value, start));
return;
}
//System.err.println("variable " + variable + " new value " + value + " type " + variable.getClass().getName());
if (variable instanceof FloatLocation) { // FIXME FIXME super ad-hoc
value = Context.jsToJava(value, Float.class);
} else if (value instanceof ObjectLocation) {
// here's a place where two locations could be bound to each other?
value = ((ObjectLocation)value).get();
} else if (value instanceof Wrapper) {
// FIXME is there a better way???
value = ((Wrapper)value).unwrap();
if (value instanceof ObjectLocation) {
value = ((ObjectLocation)value).get();
}
}
variable.set(value);
return;
} catch (Exception e) {
e.printStackTrace(System.err);
}
}