onury/docma

v2: crash if a number is used as a key

warpdesign opened this issue · 3 comments

While porting a v1 template to docma v2 I stumbled upon this crash.

After some digging it appears that what makes it crash is the following:

const obj = {
  43: "bar"
};

Replacing it with the following code works as a workaround:

const obj = {
  "43": "bar"
};

That may be fixed by v3 already but I cannot verify it since I'm focused on making my template work on Docma v2 first.

The changelog page also mentions that the getSymbolByName signatured has changed:

BREAKING: Docma utility methods are moved to DocmaWeb.Utils static namespace (formerly under docma.utils).
DocmaWeb.Utils.getSymbolByName() signature is changed.

Would be great to tell what has changed :)

onury commented

You could either check out the code or the documentation and/or use some sort of code-completion / intelli-sense. Code is documented so it should give you much proper details about the signature and more; rather than explaining every little thing in the change-log.

onury commented

Error you've mentioned is fixed with v3.0.0. Re-open if you still encounter this with v3+