Skip to content

Commit f769c3a

Browse files
authored
Merge pull request #19 from fastschema/feat.update_quickjs_20251015
feat: update quickjs 20251015
2 parents 01fa963 + d34497f commit f769c3a

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

errors_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func TestNewJsToGoErr(t *testing.T) {
198198

199199
ctx := rt.Context()
200200

201-
t.Run("JSONStringify failure path", func(t *testing.T) {
201+
t.Run("JSONStringifyFailure", func(t *testing.T) {
202202
// Create a value that will cause JSONStringify to fail
203203
circularValue := createCircularValue(ctx)
204204
defer circularValue.Free()
@@ -211,7 +211,7 @@ func TestNewJsToGoErr(t *testing.T) {
211211
assert.Contains(t, result.Error(), "[object Object]")
212212
})
213213

214-
t.Run("successful JSONStringify", func(t *testing.T) {
214+
t.Run("JSONStringifySuccess", func(t *testing.T) {
215215
value := ctx.NewString("hello")
216216
defer value.Free()
217217

qjs.wasm

5.53 KB
Binary file not shown.

qjswasm/helpers.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,17 @@ static JSValue js_navigator_get_userAgent(JSContext *ctx, JSValue this_val)
9191
return JS_NewString(ctx, version);
9292
}
9393

94-
// static const JSCFunctionListEntry global_obj[] = {
95-
// JS_CFUNC_DEF("gc", 0, js_gc),
96-
// };
94+
static const JSCFunctionListEntry global_obj[] = {
95+
JS_CFUNC_DEF("gc", 0, js_gc),
96+
};
9797

98-
// static const JSCFunctionListEntry navigator_proto_funcs[] = {
99-
// JS_CGETSET_DEF2("userAgent", js_navigator_get_userAgent, NULL, JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE),
100-
// JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Navigator", JS_PROP_CONFIGURABLE),
101-
// };
98+
static const JSCFunctionListEntry navigator_proto_funcs[] = {
99+
JS_CGETSET_DEF2("userAgent", js_navigator_get_userAgent, NULL, JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE),
100+
JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Navigator", JS_PROP_CONFIGURABLE),
101+
};
102102

103103
void js_set_global_objs(JSContext *ctx)
104104
{
105-
const JSCFunctionListEntry global_obj[] = {
106-
JS_CFUNC_DEF("gc", 0, js_gc),
107-
};
108-
const JSCFunctionListEntry navigator_proto_funcs[] = {
109-
JS_CGETSET_DEF2("userAgent", js_navigator_get_userAgent, NULL, JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE),
110-
JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Navigator", JS_PROP_CONFIGURABLE),
111-
};
112-
113105
JSValue global = JS_GetGlobalObject(ctx);
114106
JS_SetPropertyFunctionList(
115107
ctx,

qjswasm/qjswasm.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
macro(add_qjs_libc_if_needed target)
42
if(NOT QJS_BUILD_LIBC)
53
target_sources(${target} PRIVATE quickjs-libc.c)

0 commit comments

Comments
 (0)