mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-25 06:02:13 +00:00
The example should output "Hello from Rust!" (#1931)
* Make console output "Hello from Rust!" The HTML says the console would output Hello from Rust!, but instead it outputs Hello, World! This is a proposed fix. * Output "Hello from Rust!" The HTML says the console would output "Hello from Rust!" but instead it outputs "Hello, World!". This is a proposed fix.
This commit is contained in:
parent
1548953364
commit
aab99feb3e
@ -1,5 +1,5 @@
|
|||||||
export function name() {
|
export function name() {
|
||||||
return 'World';
|
return 'Rust';
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MyClass {
|
export class MyClass {
|
||||||
|
@ -26,7 +26,7 @@ extern "C" {
|
|||||||
|
|
||||||
#[wasm_bindgen(start)]
|
#[wasm_bindgen(start)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
log(&format!("Hello, {}!", name()));
|
log(&format!("Hello from {}!", name())); // should output "Hello from Rust!"
|
||||||
|
|
||||||
let x = MyClass::new();
|
let x = MyClass::new();
|
||||||
assert_eq!(x.number(), 42);
|
assert_eq!(x.number(), 42);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user