Skip to content

Commit d9ba8c5

Browse files
awesomeklinglinusg
authored andcommitted
Fix build after LibJS GC changes
JS::Script and JS::SourceTextModule are now GC-allocated, so we can't store them in NonnullRefPtr anymore.
1 parent 12503b4 commit d9ba8c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct TestError {
4646
String harness_file;
4747
};
4848

49-
using ScriptOrModuleProgram = Variant<NonnullRefPtr<JS::Script>, NonnullRefPtr<JS::SourceTextModule>>;
49+
using ScriptOrModuleProgram = Variant<JS::NonnullGCPtr<JS::Script>, JS::NonnullGCPtr<JS::SourceTextModule>>;
5050

5151
template<typename ScriptType>
5252
static Result<ScriptOrModuleProgram, TestError> parse_program(JS::Realm& realm, StringView source, StringView filepath)
@@ -151,7 +151,7 @@ static Result<StringView, TestError> read_harness_file(StringView harness_file)
151151
return cache->value.view();
152152
}
153153

154-
static Result<NonnullRefPtr<JS::Script>, TestError> parse_harness_files(JS::Realm& realm, StringView harness_file)
154+
static Result<JS::NonnullGCPtr<JS::Script>, TestError> parse_harness_files(JS::Realm& realm, StringView harness_file)
155155
{
156156
auto source_or_error = read_harness_file(harness_file);
157157
if (source_or_error.is_error())
@@ -165,7 +165,7 @@ static Result<NonnullRefPtr<JS::Script>, TestError> parse_harness_files(JS::Real
165165
harness_file
166166
};
167167
}
168-
return program_or_error.release_value().get<NonnullRefPtr<JS::Script>>();
168+
return program_or_error.release_value().get<JS::NonnullGCPtr<JS::Script>>();
169169
}
170170

171171
static Result<void, TestError> run_test(StringView source, StringView filepath, JS::Program::Type program_type, Vector<StringView> const& harness_files)

0 commit comments

Comments
 (0)