Skip to content

Commit 7138271

Browse files
committed
rebase and fix lint
1 parent 9583d72 commit 7138271

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/compiler/preprocess/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ function get_replacement(
104104
let decoded_map: DecodedSourceMap;
105105
if (processed.map) {
106106
decoded_map = typeof processed.map === 'string' ? JSON.parse(processed.map) : processed.map;
107-
if (typeof(decoded_map.mappings) === 'string')
107+
if (typeof(decoded_map.mappings) === 'string') {
108108
decoded_map.mappings = decode_mappings(decoded_map.mappings);
109+
}
109110
sourcemap_add_offset(decoded_map, get_location(offset + prefix.length));
110111
}
111112
const processed_with_map = StringWithSourcemap.from_processed(processed.code, decoded_map);
@@ -146,12 +147,13 @@ export default async function preprocess(
146147

147148
if (processed && processed.dependencies) dependencies.push(...processed.dependencies);
148149
source = processed ? processed.code : source;
149-
if (processed && processed.map)
150+
if (processed && processed.map) {
150151
sourcemap_list.unshift(
151152
typeof(processed.map) === 'string'
152153
? JSON.parse(processed.map)
153154
: processed.map
154155
);
156+
}
155157
}
156158

157159
for (const fn of script) {

src/compiler/utils/string_with_sourcemap.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ function merge_tables<T>(this_table: T[], other_table): [T[], number[], boolean,
5959
}
6060

6161
function pushArray<T>(_this: T[], other: T[]) {
62-
for (let i = 0; i < other.length; i++)
62+
for (let i = 0; i < other.length; i++) {
6363
_this.push(other[i]);
64+
}
6465
}
6566

6667
export class StringWithSourcemap {
@@ -69,15 +70,16 @@ export class StringWithSourcemap {
6970

7071
constructor(string = '', map = null) {
7172
this.string = string;
72-
if (map)
73+
if (map) {
7374
this.map = map as DecodedSourceMap;
74-
else
75+
} else {
7576
this.map = {
7677
version: 3,
7778
mappings: [],
7879
sources: [],
7980
names: []
8081
};
82+
}
8183
}
8284

8385
// concat in-place (mutable), return this (chainable)

0 commit comments

Comments
 (0)