+163
-3750
lines changedFilter options
+163
-3750
lines changed Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
15
15
#include <LibJS/Bytecode/Generator.h>
16
16
#include <LibJS/Bytecode/Interpreter.h>
17
17
#include <LibJS/Console.h>
18
-
#include <LibJS/Interpreter.h>
19
18
#include <LibJS/Parser.h>
20
19
#include <LibJS/Print.h>
21
20
#include <LibJS/Runtime/ConsoleObject.h>
Original file line number Diff line number Diff line change
@@ -17,10 +17,10 @@
17
17
#include <LibJS/Bytecode/Generator.h>
18
18
#include <LibJS/Bytecode/Interpreter.h>
19
19
#include <LibJS/Contrib/Test262/GlobalObject.h>
20
-
#include <LibJS/Interpreter.h>
21
20
#include <LibJS/Parser.h>
22
21
#include <LibJS/Runtime/VM.h>
23
22
#include <LibJS/Script.h>
23
+
#include <LibJS/SourceTextModule.h>
24
24
#include <fcntl.h>
25
25
#include <signal.h>
26
26
#include <unistd.h>
@@ -206,27 +206,28 @@ static Result<void, TestError> run_test(StringView source, StringView filepath,
206
206
207
207
auto vm = MUST(JS::VM::create());
208
208
vm->enable_default_host_import_module_dynamically_hook();
209
-
auto ast_interpreter = JS::Interpreter::create<JS::Test262::GlobalObject>(*vm);
210
-
auto& realm = ast_interpreter->realm();
211
209
212
-
auto program_or_error = parse_program(realm, source, filepath, metadata.program_type);
210
+
JS::GCPtr<JS::Realm> realm;
211
+
JS::GCPtr<JS::Test262::GlobalObject> global_object;
212
+
auto root_execution_context = MUST(JS::Realm::initialize_host_defined_realm(
213
+
*vm,
214
+
[&](JS::Realm& realm_) -> JS::GlobalObject* {
215
+
realm = &realm_;
216
+
global_object = vm->heap().allocate_without_realm<JS::Test262::GlobalObject>(realm_);
217
+
return global_object;
218
+
},
219
+
nullptr));
220
+
221
+
auto program_or_error = parse_program(*realm, source, filepath, metadata.program_type);
213
222
if (program_or_error.is_error())
214
223
return program_or_error.release_error();
215
224
216
-
auto* bytecode_interpreter = vm->bytecode_interpreter_if_exists();
217
-
218
-
auto run_with_interpreter = [&](ScriptOrModuleProgram& program) {
219
-
if (bytecode_interpreter)
220
-
return run_program(*bytecode_interpreter, program);
221
-
return run_program(*ast_interpreter, program);
222
-
};
223
-
224
225
for (auto& harness_file : metadata.harness_files) {
225
-
auto harness_program_or_error = parse_harness_files(realm, harness_file);
226
+
auto harness_program_or_error = parse_harness_files(*realm, harness_file);
226
227
if (harness_program_or_error.is_error())
227
228
return harness_program_or_error.release_error();
228
229
ScriptOrModuleProgram harness_program { harness_program_or_error.release_value() };
229
-
auto result = run_with_interpreter(harness_program);
230
+
auto result = run_program(vm->bytecode_interpreter(), harness_program);
230
231
if (result.is_error()) {
231
232
return TestError {
232
233
NegativePhase::Harness,
@@ -237,7 +238,7 @@ static Result<void, TestError> run_test(StringView source, StringView filepath,
237
238
}
238
239
}
239
240
240
-
return run_with_interpreter(program_or_error.value());
241
+
return run_program(vm->bytecode_interpreter(), program_or_error.value());
241
242
}
242
243
243
244
static Result<TestMetadata, DeprecatedString> extract_metadata(StringView source)
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
11
11
#include <AK/URL.h>
12
12
#include <LibDesktop/AppFile.h>
13
13
#include <LibGUI/Desktop.h>
14
-
#include <LibJS/Interpreter.h>
15
14
#include <LibJS/Runtime/VM.h>
16
15
#include <LibThreading/BackgroundAction.h>
17
16
#include <typeinfo>
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@
31
31
#include <LibGUI/TabWidget.h>
32
32
#include <LibGUI/ToolbarContainer.h>
33
33
#include <LibGUI/Widget.h>
34
-
#include <LibJS/Interpreter.h>
35
34
#include <LibWeb/CSS/PreferredColorScheme.h>
36
35
#include <LibWeb/Dump.h>
37
36
#include <LibWeb/Layout/Viewport.h>
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@
35
35
#include <LibGUI/Toolbar.h>
36
36
#include <LibGUI/ToolbarContainer.h>
37
37
#include <LibGUI/Window.h>
38
-
#include <LibJS/Interpreter.h>
39
38
#include <LibWeb/HTML/BrowsingContext.h>
40
39
#include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h>
41
40
#include <LibWeb/Layout/BlockContainer.h>
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
18
18
#include <AK/WeakPtr.h>
19
19
#include <AK/Weakable.h>
20
20
#include <LibCore/EventReceiver.h>
21
-
#include <LibJS/Interpreter.h>
22
21
23
22
namespace Spreadsheet {
24
23
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4