Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with creating new class type from C code and displaying list of props/functions from it. #315

Open
reinholdPL opened this issue Jun 5, 2024 · 0 comments

Comments

@reinholdPL
Copy link

When i'm creating my own class in C code (like in examples/point.c) and using it in QuickJS why can't i see props and functions from it when i'm running java script code? I mean I can access and use them, but when I'm trying to JSON.stringify that object, or assign it to another object data from class data is not visible (or it's lost in case of assign). For e.g. when I run:

import {Point} from "./examples/point.so";
let point = new Point(5,5);
console.log("point.x = "+point.x);
point.x = 10;
console.log("point.x =" + point.x);
console.log("point stringified = " + JSON.stringify(point, null,2));
let point2 = Object.assign({}, point);
console.log("point2.x = " + point2.x);

result is:

point.x = 5
point.x = 10
point stringified = {}
point2.x = undefined

TooTallNate pushed a commit to TooTallNate/quickjs that referenced this issue Jul 3, 2024
GitHub recently upgraded the ubuntu-latest images and I suspect that is
the cause of the linux-asan and linux-msan failures. Pin to the old LTS
for now.

Fixes: quickjs-ng/quickjs#314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant