graphjin 3.0.18 → 3.0.20

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphjin",
3
- "version": "3.0.18",
3
+ "version": "3.0.20",
4
4
  "description": "GraphJin - Build APIs in 5 minutes with GraphQL",
5
5
  "type": "module",
6
6
  "main": "./wasm/js/graphjin.js",
Binary file
@@ -113,6 +113,10 @@
113
113
  this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
114
114
  }
115
115
 
116
+ const setInt32 = (addr, v) => {
117
+ this.mem.setUint32(addr + 0, v, true);
118
+ }
119
+
116
120
  const getInt64 = (addr) => {
117
121
  const low = this.mem.getUint32(addr + 0, true);
118
122
  const high = this.mem.getInt32(addr + 4, true);
@@ -206,7 +210,10 @@
206
210
 
207
211
  const timeOrigin = Date.now() - performance.now();
208
212
  this.importObject = {
209
- go: {
213
+ _gotest: {
214
+ add: (a, b) => a + b,
215
+ },
216
+ gojs: {
210
217
  // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
211
218
  // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
212
219
  // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
@@ -269,7 +276,7 @@
269
276
  this._resume();
270
277
  }
271
278
  },
272
- getInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early
279
+ getInt64(sp + 8),
273
280
  ));
274
281
  this.mem.setInt32(sp + 16, id, true);
275
282
  },