mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
builtins.toJSON: fix __toString usage
This commit is contained in:
parent
c0559a1d60
commit
e583df5280
5 changed files with 29 additions and 8 deletions
|
@ -40,7 +40,12 @@ void printValueAsJSON(EvalState & state, bool strict,
|
|||
break;
|
||||
|
||||
case tAttrs: {
|
||||
Bindings::iterator i = v.attrs->find(state.sOutPath);
|
||||
auto maybeString = state.tryAttrsToString(noPos, v, context, false, false);
|
||||
if (maybeString) {
|
||||
out.write(*maybeString);
|
||||
break;
|
||||
}
|
||||
auto i = v.attrs->find(state.sOutPath);
|
||||
if (i == v.attrs->end()) {
|
||||
auto obj(out.object());
|
||||
StringSet names;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue