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

fix(ses): Improve error messages for invalid module records #802

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

kriskowal
Copy link
Member

Just some minor improvements I stumbled into in debugging for #794

@kriskowal kriskowal force-pushed the 794-ses-error-messages branch 2 times, most recently from 44ddcc2 to 6b05b91 Compare June 26, 2021 04:58
@kriskowal kriskowal force-pushed the 794-ses-error-messages branch 2 times, most recently from 0ac4108 to a7712cc Compare June 26, 2021 05:00
@kriskowal kriskowal requested a review from erights June 28, 2021 18:38
Copy link
Contributor

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +131 to +139
if (staticModuleRecord === null || typeof staticModuleRecord !== 'object') {
assert.fail(
Copy link
Contributor

Choose a reason for hiding this comment

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

If this needs to be unusually high speed code, no change suggested.

Otherwise

Suggested change
if (staticModuleRecord === null || typeof staticModuleRecord !== 'object') {
assert.fail(
assert(staticModuleRecord !== null && typeof staticModuleRecord === 'object',

or

Suggested change
if (staticModuleRecord === null || typeof staticModuleRecord !== 'object') {
assert.fail(
assert.typeof(staticModuleRecord, 'object', ... );
assert(staticModuleRecord !== null, ...);

or something along those lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

I’ve no reason to believe that the difference would make a perceptible impact on performance, but this is within a performance sensitive region of the Agoric runtime that’s struggling to get close to performance parity with nested evaluate bundles, so I think the code errs on the right side of the balance between succinctness and speed.

@kriskowal kriskowal force-pushed the 794-ses-error-messages branch 4 times, most recently from 86bd504 to 8937927 Compare July 1, 2021 21:49
@kriskowal kriskowal force-pushed the 794-ses-error-messages branch 2 times, most recently from ea9d265 to 8f9c5c9 Compare July 17, 2021 01:28
Base automatically changed from 794-rename-assemble to master July 21, 2021 23:28
@kriskowal kriskowal merged commit 5c9ba05 into master Jul 21, 2021
@kriskowal kriskowal deleted the 794-ses-error-messages branch July 21, 2021 23:28
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.

2 participants