Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

await promises in eval #246

Merged
merged 4 commits into from
Jun 3, 2017
Merged

await promises in eval #246

merged 4 commits into from
Jun 3, 2017

Conversation

bdistin
Copy link
Contributor

@bdistin bdistin commented Jun 3, 2017

Proposed Semver Increment Bump: [MAJOR/MINOR/PATCH]

patch

Changes Proposed in this Pull Request (List new items in CHANGELOG.MD)

(If Applicable) What Issue does it fix?

Fixes... promises not being resolved before eval is displayed

@@ -5,6 +5,7 @@ exports.run = async (client, msg, [code]) => {
try {
let evaled = eval(code);
if (typeof evaled !== "string") evaled = inspect(evaled);
if (evaled instanceof Promise) evaled = await evaled;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be this before inspecting it? So if the Promise returns an object, it'll be inspected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you are right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And add depth: 0 to the options, so it doesn't show too many information.

@CyberiumShadow CyberiumShadow merged commit 8da2419 into indev Jun 3, 2017
@CyberiumShadow CyberiumShadow deleted the bdistin-patch-1 branch June 3, 2017 23:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants