Skip to content

wasm32: Unify error codes and implementations - #146

Merged
josephlr merged 1 commit into
rust-random:0.2from
josephlr:error
May 25, 2020
Merged

wasm32: Unify error codes and implementations#146
josephlr merged 1 commit into
rust-random:0.2from
josephlr:error

Conversation

@josephlr

Copy link
Copy Markdown
Member

Right now, while our implementations for stdweb and wasm-bindgen use
similar APIs, they do not use similar implementations. This change:

  • Switches to using the same error codes for both implementations
  • Uses error codes that detail exactly what API is missing
  • Cleans up the implemetnations to make them much more readable
  • Consitantly use thread_local in both implementations

This makes issues easier to debug and the code easier to understand.

Signed-off-by: Joe Richey joerichey@google.com

@josephlr
josephlr requested review from dhardy and newpavlovMay 22, 2020 23:34
@josephlrjosephlr added this to the 0.2 milestone May 22, 2020
@josephlrjosephlr mentioned this pull request May 22, 2020
9 tasks
@josephlrjosephlr changed the title wasm32: Unify error codes an implementationswasm32: Unify error codes and implementationsMay 23, 2020
@josephlr

Copy link
Copy Markdown
MemberAuthor

@dhardy I fixed the CI issue, this is ready for review.

@dhardy

Copy link
Copy Markdown
Member

Sorry, I'd rather not review this myself. Could I ask @zer0x64 or @Pauan to give this a review?

@PauanPauan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

Right now, while our implementations for stdweb and wasm-bindgen use
similar APIs, they do not use similar implementations. This change:
- Switches to using the same error codes for both implementations
- Uses error codes that detail exactly what API is missing
- Cleans up the implemetnations to make them much more readable
- Consitantly use thread_local in both implementations
This makes issues easier to debug and the code easier to understand.
Signed-off-by: Joe Richey <joerichey@google.com>
@josephlr
josephlr merged commit a29180a into rust-random:0.2May 25, 2020
@josephlr
josephlr deleted the error branch May 25, 2020 20:20
Sign up for freeto 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.

3 participants

@josephlr@dhardy@Pauan