Skip to content

Data corruption in write.json when compiled #1276

@zupat

Description

@zupat

write.json seems to be changing keys that starts with an underscore _ . This only happens when executing the bytecode.

Minimal reproduction (repo):

git clone https://github.com/jinyus/arturo_bug_demo.git ;
cd arturo_bug_demo ;
./run.sh
Code
posts: read.json "./posts.json"

allPostIDs: map.with:'i posts 'p [
    #[
        "_id": get p "_id",
        "_index": i,
    ]
]

print write.json ø allPostIDs

Ouput:

Running arturo demo.art (correct)

[
    {
        "_id": "h5cwwbua",
        "_index": 0
    },
    {
        "_id": "jf0da9ku",
        "_index": 1
    }
]

Running arturo -x demo.art.bcode (modifying the key)

[
    {
        "id": "h5cwwbua",
        "index": 0
    },
    {
        "id": "jf0da9ku",
        "index": 1
    }
]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions