Skip to content

coolreader18/wasm-no-drop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

wasm-no-drop

When compiling Rust for WASM, if the code panics, drop() isn't called. This repo is a repr for that behavior.

Running

Not WASM

The code is in main.rs

Just cd to not-wasm and run cargo run. It print out "panicked at 'panic'", and then the line after should say "dropping".

WASM

The code is in lib.rs.

cd to wasm and run npm i; npm run dev. Then go to http://localhost:8080 and once it all compiles, you should see one alert box that says "no_panic", but not one that says "panic".

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published