Calling capitalize() on undefined returns an unhelpful error message
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- developer-experience
Research direction
Reproduce the call to capitalize(undefined) from the linked Ember Twiddle and inspect the capitalize entry point in @ember/string while watching the devtools console. Done means the undefined case reports a helpful, intentional error instead of the low-level replace TypeError.
Written by the indexing model from the issue text.
Description
- Twiddle here - you need to look into devtools console
The problem
When calling capitalize() on undefined:
import { capitalize } from '@ember/string';
return capitalize(undefined);
One will get a weird error:
Uncaught TypeError: Cannot read property 'replace' of undefined
at Cache.func (ember.debug.js:41546)
at Cache.get (ember.debug.js:30881)
at Object.capitalize (ember.debug.js:41770)
at ApplicationController.get foo [as foo] (about:srcdoc:35)
at getPossibleMandatoryProxyValue (ember.debug.js:14419)
at get (ember.debug.js:14485)
at ember.debug.js:46909
at runInAutotrackingTransaction (ember.debug.js:54899)
at track (ember.debug.js:55486)
at PropertyReference.value (ember.debug.js:46908)
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 14
- 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 emberjs/ember-string
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
emberjs/ember-string#447 · 40 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
emberjs/ember-string#370 · 18 comments ·
All issues in emberjs/ember-string
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100