[gjs/esm/static-imports] Fix string length calculation.
- From: Evan Welsh <ewlsh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/esm/static-imports] Fix string length calculation.
- Date: Sat, 14 Nov 2020 20:38:21 +0000 (UTC)
commit 2d19d9858de9475a333c3365e10ebb4e597efad9
Author: Evan Welsh <noreply evanwelsh com>
Date: Sat Nov 14 14:38:17 2020 -0600
Fix string length calculation.
gjs/internal.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/internal.cpp b/gjs/internal.cpp
index a92fa732..d769695e 100644
--- a/gjs/internal.cpp
+++ b/gjs/internal.cpp
@@ -247,7 +247,7 @@ static bool compile_module(JSContext* cx, JS::CallArgs args) {
JS::UniqueChars uri = JS_EncodeStringToUTF8(cx, s1);
JS::UniqueChars text = JS_EncodeStringToUTF8(cx, s2);
- size_t text_len = JS_GetStringLength(s2);
+ size_t text_len = strlen(text.get());
JS::CompileOptions options(cx);
options.setFileAndLine(uri.get(), 1).setSourceIsLazy(false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]