diff options
author | crowlKats <crowlkats@gmail.com> | 2021-05-27 07:23:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 14:23:12 +0900 |
commit | b21fa78a1e8b2c9df549b29454970b39da708a5c (patch) | |
tree | 1282055ff7703d34dc78d526ffa8ffd0b5626bee /extensions/webstorage/lib.rs | |
parent | d5d59bb794503416ced2c3ad6a2bb043f97ce3e5 (diff) |
feat(cli): add origin data dir to deno info (#10589)
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'extensions/webstorage/lib.rs')
-rw-r--r-- | extensions/webstorage/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/webstorage/lib.rs b/extensions/webstorage/lib.rs index 8b3e206fb..d2170890e 100644 --- a/extensions/webstorage/lib.rs +++ b/extensions/webstorage/lib.rs @@ -13,9 +13,9 @@ use std::fmt; use std::path::PathBuf; #[derive(Clone)] -struct LocationDataDir(PathBuf); +struct OriginStorageDir(PathBuf); -pub fn init(location_data_dir: Option<PathBuf>) -> Extension { +pub fn init(origin_storage_dir: Option<PathBuf>) -> Extension { Extension::builder() .js(include_js_files!( prefix "deno:extensions/webstorage", @@ -34,8 +34,8 @@ pub fn init(location_data_dir: Option<PathBuf>) -> Extension { ), ]) .state(move |state| { - if let Some(location_data_dir) = location_data_dir.clone() { - state.put(LocationDataDir(location_data_dir)); + if let Some(origin_storage_dir) = origin_storage_dir.clone() { + state.put(OriginStorageDir(origin_storage_dir)); } Ok(()) }) @@ -55,7 +55,7 @@ fn get_webstorage( ) -> Result<&Connection, AnyError> { let conn = if persistent { if state.try_borrow::<LocalStorage>().is_none() { - let path = state.try_borrow::<LocationDataDir>().ok_or_else(|| { + let path = state.try_borrow::<OriginStorageDir>().ok_or_else(|| { DomExceptionNotSupportedError::new( "LocalStorage is not supported in this context.", ) |