Skip to content

Commit dc8e69e

Browse files
committed
Spreadsheed: Call native functions in runtime.js on thisSheet
I think this *should* be working as-is, but there's probably something wrong with the this value of native functions. Either way, not relying on the implicit this value will allow us to use strict mode here eventually. Fixes #9240.
1 parent ac7c836 commit dc8e69e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Base/res/js/Spreadsheet/runtime.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ function range(start, end, columnStep, rowStep) {
8282
columnStep = integer(columnStep ?? 1);
8383
rowStep = integer(rowStep ?? 1);
8484
if (!(start instanceof Position)) {
85-
start = parse_cell_name(start) ?? { column: "A", row: 0 };
85+
start = thisSheet.parse_cell_name(start) ?? { column: "A", row: 0 };
8686
}
8787
if (!(end instanceof Position)) {
88-
end = parse_cell_name(end) ?? start;
88+
end = thisSheet.parse_cell_name(end) ?? start;
8989
}
9090

9191
const cells = [];
9292

93-
const start_column_index = column_index(start.column);
94-
const end_column_index = column_index(end.column);
93+
const start_column_index = thisSheet.column_index(start.column);
94+
const end_column_index = thisSheet.column_index(end.column);
9595
const start_column = start_column_index > end_column_index ? end.column : start.column;
9696
const distance = Math.abs(start_column_index - end_column_index);
9797

9898
for (let col = 0; col <= distance; col += columnStep) {
99-
const column = column_arithmetic(start_column, col);
99+
const column = thisSheet.column_arithmetic(start_column, col);
100100
for (
101101
let row = Math.min(start.row, end.row);
102102
row <= Math.max(start.row, end.row);
@@ -272,7 +272,7 @@ function column() {
272272
}
273273

274274
function here() {
275-
const position = current_cell_position();
275+
const position = thisSheet.current_cell_position();
276276
return new Position(position.column, position.row, thisSheet);
277277
}
278278

0 commit comments

Comments
 (0)