mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
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.
This commit is contained in:
parent
ac7c83689b
commit
dc8e69eb44
Notes:
sideshowbarker
2024-07-18 05:09:37 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/dc8e69eb44c Pull-request: https://github.com/SerenityOS/serenity/pull/9659 Reviewed-by: https://github.com/alimpfard ✅
1 changed files with 6 additions and 6 deletions
|
@ -82,21 +82,21 @@ function range(start, end, columnStep, rowStep) {
|
|||
columnStep = integer(columnStep ?? 1);
|
||||
rowStep = integer(rowStep ?? 1);
|
||||
if (!(start instanceof Position)) {
|
||||
start = parse_cell_name(start) ?? { column: "A", row: 0 };
|
||||
start = thisSheet.parse_cell_name(start) ?? { column: "A", row: 0 };
|
||||
}
|
||||
if (!(end instanceof Position)) {
|
||||
end = parse_cell_name(end) ?? start;
|
||||
end = thisSheet.parse_cell_name(end) ?? start;
|
||||
}
|
||||
|
||||
const cells = [];
|
||||
|
||||
const start_column_index = column_index(start.column);
|
||||
const end_column_index = column_index(end.column);
|
||||
const start_column_index = thisSheet.column_index(start.column);
|
||||
const end_column_index = thisSheet.column_index(end.column);
|
||||
const start_column = start_column_index > end_column_index ? end.column : start.column;
|
||||
const distance = Math.abs(start_column_index - end_column_index);
|
||||
|
||||
for (let col = 0; col <= distance; col += columnStep) {
|
||||
const column = column_arithmetic(start_column, col);
|
||||
const column = thisSheet.column_arithmetic(start_column, col);
|
||||
for (
|
||||
let row = Math.min(start.row, end.row);
|
||||
row <= Math.max(start.row, end.row);
|
||||
|
@ -272,7 +272,7 @@ function column() {
|
|||
}
|
||||
|
||||
function here() {
|
||||
const position = current_cell_position();
|
||||
const position = thisSheet.current_cell_position();
|
||||
return new Position(position.column, position.row, thisSheet);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue