1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

builtins.toJSON: fix __toString usage

This commit is contained in:
Robin Gloster 2019-10-27 10:15:51 +01:00
parent c0559a1d60
commit e583df5280
No known key found for this signature in database
GPG key ID: D5C458DF6DD97EDF
5 changed files with 29 additions and 8 deletions

View file

@ -1 +1 @@
"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44}"
"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44,\"k\":\"foo\"}"

View file

@ -9,4 +9,5 @@ builtins.toJSON
h = [ "a" [ "b" { "foo\nbar" = {}; } ] ];
i = 1 + 2;
j = 1.44;
k = { __toString = self: self.a; a = "foo"; };
}