StringBuffer sig = new StringBuffer(); for (int i = 0; i < values.length; i++) { if (i != 0) sig.append(','); sig.append(scriptSignature(values[i]));
if (value == null) { return "null"; } else if (value instanceof Boolean) { return "boolean"; } else if (value instanceof String) { return "string"; } else if (value instanceof Number) { return "number"; } else if (value instanceof Scriptable) { if (value instanceof Undefined) { return "undefined"; } else if (value instanceof Wrapper) { Object wrapped = ((Wrapper)value).unwrap(); return wrapped.getClass().getName(); } else if (value instanceof Function) { return "function"; } else { return "object"; } } else { return javaSignature(value.getClass());
    static String scriptSignature(Object[] values)    {        StringBuffer sig = new StringBuffer();        for (int i = 0; i < values.length; i++) {            if (i != 0)                sig.append(',');            sig.append(scriptSignature(values[i]));        }        return sig.toString();    }