Add ?? with nullsafe or default value.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- compilers
Research direction
Start by reading the linked Jsonnet, sjsonnet, and jrsonnet references to compare the proposed null-coalescing syntax and behavior. Trace the existing expression syntax and evaluation entry points in Jsonnet, then add tests covering a null-safe lookup with a default value; done means the example evaluates as requested without changing non-null behavior.
Written by the indexing model from the issue text.
Description
refs: https://github.com/google/jsonnet/issues/930
better to have it as
maybeNullObj?['someField'] ?? 'defaultValue'
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing
refs in sjsonnet: https://github.com/databricks/sjsonnet/issues/328
refs: https://github.com/CertainLach/jrsonnet/blob/master/docs/features.adoc#exp-null-coalescing
refs: https://tace.alibaba-inc.com/#/tmcp/ali-office/server/supermall/detail?businessId=huming-guarden&selectedKeys=server
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/jsonnet
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
-
std.format: wrong digits for %f/%d on large values; malformed output for non-integer * precision Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EricSpencer00/Resilient#4824 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
mlir
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
llvm/llvm-project#224908 · 1 comment ·