From f57a2c1e85387afe48b7bdb57176dafb156bb86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 6 Sep 2020 21:44:29 +0200 Subject: refactor(core): rename CoreIsolate to JsRuntime (#7373) deno_core/ - rename core_isolate.rs to runtime.rs - rename CoreIsolate to JsRuntime - rename JSError to JsError - rename JSStackFrame to JsStackFrame cli/ - update references from deno_core::CoreIsolate to deno_core::JsRuntime - rename deno_core::JSError to deno_core::JsError - rename fmt_errors::JSError to fmt_errors::JsError --- core/errors.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/errors.rs') diff --git a/core/errors.rs b/core/errors.rs index 2ce12689a..3e42fb937 100644 --- a/core/errors.rs +++ b/core/errors.rs @@ -110,23 +110,23 @@ impl From> for ErrBox { } } -/// A `JSError` represents an exception coming from V8, with stack frames and -/// line numbers. The deno_cli crate defines another `JSError` type, which wraps +/// A `JsError` represents an exception coming from V8, with stack frames and +/// line numbers. The deno_cli crate defines another `JsError` type, which wraps /// the one defined here, that adds source map support and colorful formatting. #[derive(Debug, PartialEq, Clone)] -pub struct JSError { +pub struct JsError { pub message: String, pub source_line: Option, pub script_resource_name: Option, pub line_number: Option, pub start_column: Option, // 0-based pub end_column: Option, // 0-based - pub frames: Vec, + pub frames: Vec, pub formatted_frames: Vec, } #[derive(Debug, PartialEq, Clone)] -pub struct JSStackFrame { +pub struct JsStackFrame { pub type_name: Option, pub function_name: Option, pub method_name: Option, @@ -152,7 +152,7 @@ fn get_property<'a>( object.get(scope, key.into()) } -impl JSError { +impl JsError { pub(crate) fn create(js_error: Self) -> ErrBox { js_error.into() } @@ -199,7 +199,7 @@ impl JSError { formatted_frames_v8.and_then(|a| a.try_into().ok()); // Convert them into Vec and Vec respectively. - let mut frames: Vec = vec![]; + let mut frames: Vec = vec![]; let mut formatted_frames: Vec = vec![]; if let (Some(frames_v8), Some(formatted_frames_v8)) = (frames_v8, formatted_frames_v8) @@ -292,7 +292,7 @@ impl JSError { .try_into() .ok(); let promise_index = promise_index.map(|n| n.value()); - frames.push(JSStackFrame { + frames.push(JsStackFrame { type_name, function_name, method_name, @@ -343,7 +343,7 @@ impl JSError { } } -impl Error for JSError {} +impl Error for JsError {} fn format_source_loc( file_name: &str, @@ -355,7 +355,7 @@ fn format_source_loc( format!("{}:{}:{}", file_name, line_number, column_number) } -impl fmt::Display for JSError { +impl fmt::Display for JsError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(script_resource_name) = &self.script_resource_name { if self.line_number.is_some() && self.start_column.is_some() { -- cgit v1.2.3