Skip to content

Commit 996824d

Browse files
author
Simon Holthausen
committed
variable name, code style
1 parent a2ff579 commit 996824d

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/mapping.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
11
import { decode } from 'sourcemap-codec';
22

33
class GeneratedFragmentMapper {
4-
constructor(
5-
generated_code,
6-
tag_info,
7-
) {
4+
constructor(generated_code, diff) {
85
this.generated_code = generated_code;
9-
this.tag_info = tag_info;
6+
this.diff = diff;
107
}
118

129
get_position_relative_to_fragment(position_relative_to_file) {
1310
const fragment_offset = this.offset_in_fragment(offset_at(position_relative_to_file, this.generated_code));
14-
return position_at(fragment_offset, this.tag_info.generated_content);
11+
return position_at(fragment_offset, this.diff.generated_content);
1512
}
1613

1714
offset_in_fragment(offset) {
18-
return offset - this.tag_info.generated_start
15+
return offset - this.diff.generated_start
1916
}
2017
}
2118

2219
class OriginalFragmentMapper {
23-
constructor(
24-
original_code,
25-
tag_info,
26-
) {
20+
constructor(original_code, diff) {
2721
this.original_code = original_code;
28-
this.tag_info = tag_info;
22+
this.diff = diff;
2923
}
3024

3125
get_position_relative_to_file(position_relative_to_fragment) {
32-
const parent_offset = this.offset_in_parent(offset_at(position_relative_to_fragment, this.tag_info.original_content));
26+
const parent_offset = this.offset_in_parent(offset_at(position_relative_to_fragment, this.diff.original_content));
3327
return position_at(parent_offset, this.original_code);
3428
}
3529

3630
offset_in_parent(offset) {
37-
return this.tag_info.original_start + offset;
31+
return this.diff.original_start + offset;
3832
}
3933
}
4034

0 commit comments

Comments
 (0)