Search in sources :

Example 1 with JsString

use of elemental2.core.JsString in project vue-gwt by Axellience.

the class VueDirectiveOptions method getFunctionBody.

private String getFunctionBody(Function jsFunction) {
    JsString jsString = cast(jsFunction.toString());
    // Get content between first { and last }
    JsString m = cast(jsString.match(new JsRegExp("\\{([\\s\\S]*)\\}", "m"))[1]);
    // Strip comments
    return m.replace(new JsRegExp("^\\s*\\/\\/.*$", "mg"), "").trim();
}
Also used : JsRegExp(elemental2.core.JsRegExp) JsString(elemental2.core.JsString)

Aggregations

JsRegExp (elemental2.core.JsRegExp)1 JsString (elemental2.core.JsString)1