improve log output of Callable's#1213
Conversation
|
You sure it should automatically stringify the function including the body? Not at my laptop, but I think Chrome just logs [Function] (for JavaScript functions, and [native function] for non-js functions. And if you want to log the entire function incl. the body, you have to call {{function}}.toString() yourself. Not sure how your PR handles non-JS functions Logging the entire function source might even be a bit of a security issue, depending on the context. |
|
At least better than logging null :-D |
| StringBuilder sb = new StringBuilder(); | ||
| sb.append("function ") | ||
| .append(((BaseFunction) value).getFunctionName()) | ||
| .append("() {}"); |
There was a problem hiding this comment.
Wondering whether this should not be "() {...}" to make it clearer that the body content was stripped
40daad9 to
c74ce20
Compare
|
LGTM |
|
@p-bakker many thanks for all the reviews |
|
This looks good to me. I'll work on merging it soon. |
NativeJSON.stringify outputs Callable's as null, convert to string to make the log output less confusing