calling javascript function from C #1121
Unanswered
espruino-discuss
asked this question in
JavaScript
Replies: 2 comments
-
Posted at 2017-10-18 by @gfwilliams The issue isn't executing a function - it's just that the function you have defined in C isn't returning a value (so it'll be returning some random memory address). If you stick a |
Beta Was this translation helpful? Give feedback.
0 replies
-
Posted at 2017-10-18 by JumJum Business as usual, problems between ears of developer ;-) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-10-18 by JumJum
I would like to call a javascript function from c and use the return value.
In first test:
got this error, after ExecJS(function(){return 99;}); whats wrong ?
WARNING: na sowas: 99
WARNING: done
=ASSERT(v->flags == JSV_UNUSED) FAILED AT src/jsvar.c:399
#1[r1,l2] Object {
#2[r1,l2] Name String [1 blocks] "\xFF" #3[r1,l2] Object {
#6[r1,l2] Name String [2 blocks] "timers" #8[r2,l1] Array(0) [ ]
#9[r1,l2] Name String [2 blocks] "watches" #11[r2,l1] Array(0) [ ]
#13[r1,l2] Name String [1 blocks] "net" #14[r1,l2] String [1 blocks] "\x05\x00\x00\x00\x00\xFF\xFF\xFF"
#15[r1,l2] Name String [2 blocks] "history" #25[r1,l1] Array(2) [
#26[r1,l2] Name Integer 0 #19[r1,l1] String [5 blocks] "console.log("<","<<",JSON.stringify(process.env),">>",">")"
#224[r1,l2] Name Integer 1 #213[r1,l1] String [3 blocks] "ExecJS(function(){return 99;});"
]
}
#17[r1,l2] Name String [2 blocks] "console" #18[r1,l1] NativeFunction 0x40123264 (1) { }
#28[r1,l2] Name String [1 blocks] "JSON" #27[r1,l1] NativeFunction 0x401232ac (1) { }
#33[r1,l2] Name String [2 blocks] "process" #32[r1,l1] NativeFunction 0x40123210 (1) { }
}
HALTING.
Beta Was this translation helpful? Give feedback.
All reactions