When LAZY_IN_SYNC is invoked with a symbol it might throw an error because the JS runtime doesn't know how to stringify a symbol on its own for some reason.
When passing a function/class as key, then the output gets weird as the JS runtime may return the whole class body when stringifying it.
This PR adjusts the way the key is stringified by:
If it's a function then print as [function/class NAME].
If it's a symbol then we explicitly convert it to string using symbol.toString() before printing.
Description
LAZY_IN_SYNC
is invoked with a symbol it might throw an error because the JS runtime doesn't know how to stringify a symbol on its own for some reason.This PR adjusts the way the key is stringified by:
[function/class NAME]
.symbol.toString()
before printing.Related Issue
https://github.com/inversify/InversifyJS/issues/1510
Motivation and Context
Better error message.
How Has This Been Tested?
Manually called
LAZY_IN_SYNC
with a symbol using the node REPL.Types of changes
Checklist: