bitburner-official / bitburner-src

Bitburner source code.
Other
837 stars 273 forks source link

API: Improve built-in print APIs when printing Promise objects #1710

Closed catloversg closed 1 month ago

catloversg commented 1 month ago

When the player prints Promise objects, those objects are serialized into {}. This may be confusing in some cases. This PR adds a special case in argsToString to handle this situation.

Closes #1706.

Before: before

After: after

d0sboots commented 1 month ago

Adding a replacer also gives us a hook to add printing for Sets/Maps if we want to add that later.