}
public static String call(PageContext pc, Object var, String jsName,boolean outputFormat, boolean asFormat) throws PageException {
//if(!Decision.isVariableName(jsName))
// throw new FunctionException(pc,"toScript",2,"jsName","value does not contain a valid variable String");
JSConverter converter = new JSConverter();
converter.useShortcuts(asFormat);
converter.useWDDX(outputFormat);
try {
return converter.serialize(var,jsName);
}
catch (ConverterException e) {
throw Caster.toPageException(e);
}
}