_env.warning(L.l("json_encode: type is unsupported; encoded as null.")); sb.append("null");
throw new Exception( "json_encode: type is unsupported; encoded as null.");
  private void jsonEncodeImpl(StringBuilderValue sb, Value val)  {    if (val instanceof StringValue) {      sb.append('"');      encodeString(sb, (StringValue)val);      sb.append('"');    }    else if (val == BooleanValue.TRUE)      sb.append("true");    else if (val == BooleanValue.FALSE)      sb.append("false");    else if (val instanceof NumberValue)      sb.append(val.toStringValue());    else if (val instanceof ArrayValue)      encodeArray(sb, (ArrayValue)val);    else if (val instanceof ObjectValue)      encodeObject(sb, (ObjectValue)val);    else if (val == NullValue.NULL || val == null)      sb.append("null");    else {      _env.warning(L.l("json_encode: type is unsupported; encoded as null."));      sb.append("null");    }  }