toJsCode function

List<String> toJsCode(
  1. List x
)

Converts all elements in a list to the literal in JavaScript. Use actual variable if the element is a JsRef.

Implementation

List<String> toJsCode(List x) {
  return x.map((e) {
    if (e.runtimeType == JsRef) {
      return (e as JsRef).toJsCode();
    } else {
      return jsonEncode(e);
    }
  }).toList();
}