We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e76f37d commit b7d5974Copy full SHA for b7d5974
src/compiler/utils/string_with_sourcemap.ts
@@ -59,14 +59,16 @@ function merge_tables<T>(
59
): { table: T[]; new_idx: number[] } {
60
const table = original.slice();
61
const new_idx = [];
62
- for (let j = 0; j < original.length; j++) {
63
- const current = extended[j];
64
- const existing = table.indexOf(current);
65
- if (existing < 0) {
66
- table.push(current);
67
- new_idx[j] = table.length - 1;
68
- } else {
69
- new_idx[j] = existing;
+ if (extended) {
+ for (let j = 0; j < extended.length; j++) {
+ const current = extended[j];
+ const existing = table.indexOf(current);
+ if (existing == -1) {
+ table.push(current);
+ new_idx[j] = table.length - 1;
+ } else {
70
+ new_idx[j] = existing;
71
+ }
72
}
73
74
return { table, new_idx };
0 commit comments