Search in sources :

Example 1 with JSConverter

use of lucee.runtime.converter.JSConverter in project Lucee by lucee.

the class ToScript method call.

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);
    }
}
Also used : ConverterException(lucee.runtime.converter.ConverterException) JSConverter(lucee.runtime.converter.JSConverter)

Aggregations

ConverterException (lucee.runtime.converter.ConverterException)1 JSConverter (lucee.runtime.converter.JSConverter)1