diff options
Diffstat (limited to 'cli/js_errors.rs')
-rw-r--r-- | cli/js_errors.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cli/js_errors.rs b/cli/js_errors.rs index 0bcc1176f..ae49ed636 100644 --- a/cli/js_errors.rs +++ b/cli/js_errors.rs @@ -137,10 +137,10 @@ impl SourceMap { } } -fn frame_apply_source_map( +fn frame_apply_source_map<G: SourceMapGetter>( frame: &StackFrame, mappings_map: &mut CachedMaps, - getter: &dyn SourceMapGetter, + getter: &G, ) -> StackFrame { let maybe_sm = get_mappings(frame.script_name.as_ref(), mappings_map, getter); let frame_pos = ( @@ -181,9 +181,9 @@ fn frame_apply_source_map( } } -pub fn apply_source_map( +pub fn apply_source_map<G: SourceMapGetter>( js_error: &JSError, - getter: &dyn SourceMapGetter, + getter: &G, ) -> JSError { let mut mappings_map: CachedMaps = HashMap::new(); let mut frames = Vec::<StackFrame>::new(); @@ -232,9 +232,9 @@ fn builtin_source_map(script_name: &str) -> Option<Vec<u8>> { } } -fn parse_map_string( +fn parse_map_string<G: SourceMapGetter>( script_name: &str, - getter: &dyn SourceMapGetter, + getter: &G, ) -> Option<SourceMap> { builtin_source_map(script_name) .or_else(|| getter.get_source_map(script_name)) @@ -243,10 +243,10 @@ fn parse_map_string( }) } -fn get_mappings<'a>( +fn get_mappings<'a, G: SourceMapGetter>( script_name: &str, mappings_map: &'a mut CachedMaps, - getter: &dyn SourceMapGetter, + getter: &G, ) -> &'a Option<SourceMap> { mappings_map .entry(script_name.to_string()) |