Repository navigation
Raw expression support - #12007
Raw expression support#12007
Conversation
tobrun
left a comment
There was a problem hiding this comment.
Looks good couple of remarks before 🚢
| } | ||
|
|
||
| private static Gson getGsonInstance() { | ||
| return gson = gson != null ? gson : new Gson(); |
There was a problem hiding this comment.
what is the need for lazy initialising? Think we can directly initialise it in the field without too much overhead.
| String string = (String) object; | ||
| if (string.length() > 1 && | ||
| string.charAt(0) == '\"' && string.charAt(string.length() - 1) == '\"') { | ||
| object = string.substring(1, string.length() - 1); |
| * <p> | ||
| * If this expression contains a coma (,) delimited literal, like 'rgba(r, g, b, a)`, | ||
| * it will be enclosed with double quotes ("). | ||
| * |
There was a problem hiding this comment.
need to close </p> javadoc paragraph
| stop("layer1", 2), | ||
| stop("layer2", 2.7)); | ||
| assertEquals("expressions should match", expected, raw(expected.toString())); | ||
| } |
There was a problem hiding this comment.
extract tests into separate tests methods to explain intent / track down test faillure
733b89c to
c9d188c
Compare
| if (object instanceof String) { | ||
| object = unwrapStringLiteral((String) object); | ||
| } else if (object instanceof Number) { | ||
| object = ((Number) object).floatValue(); |
There was a problem hiding this comment.
Noting, that in order to make serialization/deserialization and testing of raw expressions easier I'm converting every Number literal to a Float to keep it consistent since JSON format isn't integer-aware. This forced adjustments in a lot of test cases.
|
Ready for another round @tobrun. |
Closes #11158.