ts-types-esm: Model.createBindingContext returns Context|undefined

Open
#335 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

Start by locating the TypeScript declaration and implementation for Model.createBindingContext, then trace how it calls resolve and handles a missing parent context. Compare the declared return type with the null or undefined behavior described in the issue. Done means the intended behavior and nullability are made consistent, with relevant tests updated or added if the project has coverage for this API.

Written by the indexing model from the issue text.

Description

UI5 code issue (not TS related)

This is not so much a jsdoc error as a weird / stupid behavior (imo)

createBindingContext can apparently return in some case undefined (technically null based on the implementation) however when writing code this will never happen except when you do some weird thing.

It implies that resolve returns undefined (which btw is not in the signature) which would only happen if you have a relative binding without a parent context defined...

So ok it could happen but you'd be really looking for trouble writing such code :)
I wonder if it really makes sense to return undefined at all or if you should have an unresolveable context of some kind in there somewhere.

Dominant language
TypeScript
Stars
213
Forks
35
Avg merge
37m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UI5/typescript

All issues in UI5/typescript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.