mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Spreadsheet: Port to Core::File
This commit is contained in:
committed by
Andreas Kling
parent
0d46c27741
commit
fd0b809d54
@@ -16,7 +16,7 @@
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <AK/TemporaryChange.h>
|
||||
#include <AK/URL.h>
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Parser.h>
|
||||
#include <LibJS/Runtime/AbstractOperations.h>
|
||||
@@ -49,9 +49,9 @@ Sheet::Sheet(Workbook& workbook)
|
||||
|
||||
// Sadly, these have to be evaluated once per sheet.
|
||||
constexpr auto runtime_file_path = "/res/js/Spreadsheet/runtime.js"sv;
|
||||
auto file_or_error = Core::DeprecatedFile::open(runtime_file_path, Core::OpenMode::ReadOnly);
|
||||
auto file_or_error = Core::File::open(runtime_file_path, Core::File::OpenMode::Read);
|
||||
if (!file_or_error.is_error()) {
|
||||
auto buffer = file_or_error.value()->read_all();
|
||||
auto buffer = file_or_error.value()->read_until_eof().release_value_but_fixme_should_propagate_errors();
|
||||
auto script_or_error = JS::Script::parse(buffer, interpreter().realm(), runtime_file_path);
|
||||
if (script_or_error.is_error()) {
|
||||
warnln("Spreadsheet: Failed to parse runtime code");
|
||||
|
||||
Reference in New Issue
Block a user