question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameter defaults with spaces

See original GitHub issue

I have a scenario where I create a new instance of an object as a default value, e.g.:

@param {SomeObject} [param=new DefaultSomeObject()] - A complex default parameter

Right now, this does not parse correctly (it cuts off at the first space, i.e. after the new).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
evolutionxboxcommented, Mar 11, 2016

One quick fix for this is to use a non breaking space HTML entity (thanks to @sandrastenzi).

@param {SomeObject} [param=new DefaultSomeObject()] - A complex default parameter

This works in ESDoc v0.4.6

0reactions
h13i32marucommented, Dec 31, 2016

I fixed this. And I will release in next version. Please check it via developing version.

https://github.com/esdoc/esdoc/commit/728fba3b123b9ee13b473379e32e709ed59dada6

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 8, why no spaces around '=' in keyword argument or a ...
I guess that it is because a keyword argument is essentially different than a variable assignment. For example, there is plenty of code...
Read more >
SPACE parameter - IBM
When defining VIO data sets, be aware that a SPACE parameter in the JCL or the SPACE value defined for a data class...
Read more >
Specify Default Space Type Settings | Revit 2018
Use the Building/Space Type Settings dialog to create, duplicate, rename, ... In the right panel, adjust individual parameters as needed.
Read more >
Default Parameter Values | Beginner Python Course
This is where default parameter values come in. You may also hear them called "default arguments". ... The values separated by spaces.
Read more >
"Use spaces around the = operator when assigning default ...
"Use spaces around the = operator when assigning default values" is just inefficient #193 ... Consider keyword arguments: def some_method(optional=1, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found