Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Upgrade to Babel 7 #1047

Merged
merged 1 commit into from
Jul 25, 2019
Merged

chore(deps): Upgrade to Babel 7 #1047

merged 1 commit into from
Jul 25, 2019

Conversation

jstoffan
Copy link
Collaborator

I had to modify the PreviewError class slightly because this.message didn't seem to be getting set properly after being transpiled. It looks like modifying built-ins the way we have can be a little tricky.

@jstoffan jstoffan requested a review from a team as a code owner July 24, 2019 01:58
@boxcla
Copy link

boxcla commented Jul 24, 2019

Verified that @jstoffan has signed the CLA. Thanks for the pull request!

mickr
mickr previously approved these changes Jul 25, 2019
src/lib/PreviewError.js Show resolved Hide resolved
ConradJChan
ConradJChan previously approved these changes Jul 25, 2019
// Pass remaining arguments to parent constructor
super(...params);
super(message, ...params);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the parent constructor wants [message, fileName, lineNumber], you can probably get rid of ...params since latter two are optional and not passed in for PreviewErrors usage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I didn't see them passed in anywhere, but I wanted to stay as close to the original implementation as possible.

Copy link
Contributor

@priyajeet priyajeet Jul 25, 2019

Choose a reason for hiding this comment

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

Also PreviewError's 2nd arg is the message, aka displayMessage, so shouldn't it be super(displayMessage)? And if so, maybe you wont need line 45

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope. If both are passed in, this.message should still be the original message, not the display message.

priyajeet
priyajeet previously approved these changes Jul 25, 2019
@mergify mergify bot merged commit bad7359 into box:master Jul 25, 2019
@jstoffan jstoffan deleted the upgrade-babel branch March 4, 2020 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants