repl: Create dumy Wasm implementations of SystemTime and Duration

This commit is contained in:
Brian Carroll 2022-02-09 08:14:58 +00:00
parent 8e370a32b6
commit a0ccae2865
3 changed files with 50 additions and 1 deletions

View file

@ -43,9 +43,13 @@ use std::iter;
use std::path::{Path, PathBuf};
use std::str::from_utf8_unchecked;
use std::sync::Arc;
use std::time::{Duration, SystemTime};
use std::{env, fs};
#[cfg(not(target_family = "wasm"))]
use std::time::{Duration, SystemTime};
#[cfg(target_family = "wasm")]
use wasm_system_time::{Duration, SystemTime};
/// Default name for the binary generated for an app, if an invalid one was specified.
const DEFAULT_APP_OUTPUT_PATH: &str = "app";