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

near.panic() deleted #171

Merged
merged 3 commits into from
Aug 15, 2022
Merged

near.panic() deleted #171

merged 3 commits into from
Aug 15, 2022

Conversation

volovyks
Copy link
Collaborator

@volovyks volovyks commented Aug 9, 2022

In this PR we are enforcing the usage of throw Error(msg) over the near.panic(msg) as a more familiar syntax for JS developers.
Also, it appeared that throw Error(msg) also prints the line where this error happened, which is useful.

@volovyks volovyks marked this pull request as ready for review August 10, 2022 14:49
@volovyks volovyks requested a review from ailisp as a code owner August 10, 2022 14:49
@volovyks volovyks linked an issue Aug 10, 2022 that may be closed by this pull request
Comment on lines 71 to 73
export function panicUtf8(msg) {
env.panic_utf8(msg);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is it intentional to keep this? Or is this intended to be if someone did not want to include the debug info (line number, etc)?

Copy link
Member

Choose a reason for hiding this comment

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

See our discussion here: #131 (comment)

Copy link
Member

@ailisp ailisp left a comment

Choose a reason for hiding this comment

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

Looks good!

@volovyks volovyks merged commit 1db2e87 into develop Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete near.panic()
3 participants