From b21fa78a1e8b2c9df549b29454970b39da708a5c Mon Sep 17 00:00:00 2001 From: crowlKats Date: Thu, 27 May 2021 07:23:12 +0200 Subject: feat(cli): add origin data dir to deno info (#10589) Co-authored-by: Nayeem Rahman Co-authored-by: Luca Casonato Co-authored-by: Yoshiya Hinosawa --- extensions/webstorage/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extensions') 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) -> Extension { +pub fn init(origin_storage_dir: Option) -> Extension { Extension::builder() .js(include_js_files!( prefix "deno:extensions/webstorage", @@ -34,8 +34,8 @@ pub fn init(location_data_dir: Option) -> 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::().is_none() { - let path = state.try_borrow::().ok_or_else(|| { + let path = state.try_borrow::().ok_or_else(|| { DomExceptionNotSupportedError::new( "LocalStorage is not supported in this context.", ) -- cgit v1.2.3