quickjs 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95d674410910d349e2516908eb9856497e150d762b43d4ef8166fa057735164b
4
- data.tar.gz: 4f605447ac29745e811f6892d0328b1423b8e3d456d278ed4ad0358273a581c5
3
+ metadata.gz: 4a2c456cd81f2a2d5085e720a1872ffc7ee873c49319db8fc0459f2c6336e437
4
+ data.tar.gz: a2881627264f8d69bdf04f3773630f17eacd9c03d5fbaa59c521ce7590ff3778
5
5
  SHA512:
6
- metadata.gz: d135b91487315a81758b37550bb3213a3ec9b565f552ad670b07420bbb06733fc635446b82e89a2f7dd79c7d4bfe3228933655874829f3c8f76d4b3b9f96c3ff
7
- data.tar.gz: acad0e1cd26f6f8b55e2596bdb616d6c93ed49190af6ff3e9e4bc4b886fd6756c51f98a8d9b40e8bb442f70521f0fc283e375eb682dd75036d3436581a7f285f
6
+ metadata.gz: 1733ef77baf22132775c06ea988ad66f8e29712a92221513894ab31173fcd165edfa6ca2a32ca855ba5d641abda6613a0419f34baf32a59a47886b98385b4836
7
+ data.tar.gz: 910f2e1d364f873261a3a4caa092427101dd64bfeaefb497fafc6caa64dd5ae4fc2d42559f31829a350d7329bef3f887f557afe1449e934516ed10d7e638b25a
@@ -115,19 +115,13 @@ VALUE r_try_json_parse(VALUE r_str)
115
115
 
116
116
  VALUE to_r_json(JSContext *ctx, JSValue j_val)
117
117
  {
118
- JSValue j_global = JS_GetGlobalObject(ctx);
119
- JSValue j_jsonClass = JS_GetPropertyStr(ctx, j_global, "JSON");
120
- JSValue j_stringifyFunc = JS_GetPropertyStr(ctx, j_jsonClass, "stringify");
121
- JSValue j_strigified = JS_Call(ctx, j_stringifyFunc, j_jsonClass, 1, (JSValueConst *)&j_val);
118
+ JSValue j_stringified = JS_JSONStringify(ctx, j_val, JS_UNDEFINED, JS_UNDEFINED);
122
119
 
123
- const char *msg = JS_ToCString(ctx, j_strigified);
120
+ const char *msg = JS_ToCString(ctx, j_stringified);
124
121
  VALUE r_str = rb_str_new2(msg);
125
122
  JS_FreeCString(ctx, msg);
126
123
 
127
- JS_FreeValue(ctx, j_strigified);
128
- JS_FreeValue(ctx, j_stringifyFunc);
129
- JS_FreeValue(ctx, j_jsonClass);
130
- JS_FreeValue(ctx, j_global);
124
+ JS_FreeValue(ctx, j_stringified);
131
125
 
132
126
  return r_str;
133
127
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Quickjs
4
- VERSION = "0.6.3"
4
+ VERSION = "0.6.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - hmsk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-24 00:00:00.000000000 Z
11
+ date: 2025-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json