package com.drawbridge.jsengine.jsobjects; public class Context extends JSObject{ public Context() { super.addProperty("drawImage", new JSNativeFunction(this, "drawImage", new Class<?>[] {JSImage.class, JSNumber.class, JSNumber.class, JSNumber.class, JSNumber.class})); super.addProperty("fillRect", new JSNativeFunction(this, "fillRect", new Class<?>[] {JSNumber.class, JSNumber.class, JSNumber.class, JSNumber.class})); } public String toString(){ return "[Context]"; } @Override public JSType getProperty(String name){ return properties.get(name); } @Override public void addProperty(String name, JSType value){ // Can't add properties to a number } }