https://github.com/coolreader18/wasm-no-drop
https://github.com/coolreader18/wasm-no-drop
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/coolreader18/wasm-no-drop
- Owner: coolreader18
- Created: 2019-03-02T14:24:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-02T16:01:04.000Z (almost 7 years ago)
- Last Synced: 2025-01-25T10:28:23.621Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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`](not-wasm/src/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`](wasm/crate/src/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".