summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-12-06 08:33:32 -0500
committerLinus Groh <mail@linusgroh.de>2022-12-06 13:53:24 +0000
commitd50b9165cd43a3ef61c56de563815ba766b86a27 (patch)
treef04b6cfac5ef3e152091f12e0f9b2b77bc54e9b5
parentfcc3348bc8f66686e308e9b05eaba5bb80199f12 (diff)
downloadserenity-d50b9165cd43a3ef61c56de563815ba766b86a27.zip
Meta: Manually compute the length of the WASM JS REPL source string
The REPL does not have a reliable way to tell us the UTF-8 byte count of the source string, so we must use strlen() ourselves.
-rw-r--r--Meta/Lagom/Wasm/js_repl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Meta/Lagom/Wasm/js_repl.cpp b/Meta/Lagom/Wasm/js_repl.cpp
index 232df58c7e..cc89a4a214 100644
--- a/Meta/Lagom/Wasm/js_repl.cpp
+++ b/Meta/Lagom/Wasm/js_repl.cpp
@@ -386,7 +386,7 @@ extern "C" int initialize_repl(char const* time_zone)
return 0;
}
-extern "C" bool execute(char const* s, u32 length)
+extern "C" bool execute(char const* source)
{
- return parse_and_run(*g_interpreter, { s, length }, "REPL"sv);
+ return parse_and_run(*g_interpreter, { source, strlen(source) }, "REPL"sv);
}