Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

(fix) Allow missing fields in serialized JSON for optional fields #492

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/javascript/ergo-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ function deref(receiver, member) {
ans = left(ans);
return ans;
}
return undefined;
// Treat a missing field as a field containing null
return null;
}
function looksLikeRelationship(v) {
// As the name suggests, this is only heuristic. We call it a relationship if it has two or three members.
Expand Down
2 changes: 1 addition & 1 deletion mechanization/Version.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Require Import String.

Section Version.
Definition ergo_version := "0.5.7"%string.
Definition ergo_version := "0.5.8"%string.

End Version.

4 changes: 2 additions & 2 deletions packages/ergo-cli/lib/ergoc-lib.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ergo-cli/lib/ergotop-lib.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ergo-compiler/lib/ergo-core.js

Large diffs are not rendered by default.