release: v2.2.2 V_safe JSON integer refuse on foreign bridge
Align host json encode/decode with Lean ForeignJSON: refuse OOD integers instead of silent Node distortion; keep decimal-string BigInt author path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
58791fc7d9
commit
82c8d78fd3
21 files changed
+449
-17
No files matched your search
@@ -0,0 +1,24 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: foreign V_safe string to Node BigInt
|
||||
import:
|
||||
foreign: lib/foreign.mq.md
|
||||
json: lib/json.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**node = > foreign.session_open lang="node" timeout=30**
|
||||
**s = "1152921504606846977"**
|
||||
|
||||
`inc` =
|
||||
```javascript
|
||||
const out = (BigInt(globalThis.__s) + 1n).toString();
|
||||
console.log(JSON.stringify({out}));
|
||||
```
|
||||
|
||||
**> foreign.session_set id=`node` name="__s" value=`s`**
|
||||
**js = > foreign.session_eval id=`node` code=`inc`**
|
||||
**js_out = > json.get value=`js` key="stdout"**
|
||||
**> print text=`js_out`**
|
||||
**> foreign.session_close id=`node`**
|
||||
Reference in new issue
Block a user