Closed kinju4374 closed 8 years ago
Using ChakraCore ch
from command line, I haven't get any error;
function a(){
return 10;
};
function b(){
return 20;
};
function c(){
return 30;
};
function abc(){
return a()*b()*c();
}
print(abc())
When I am using print, I am getting, print is undefined. But when I add z=abc()
then execute, it gives me 6000 which is correct output.
Indeed print
is defined by ch
host. My guess is you use this script from your app that embeds ChakraCore?
In that case, you don't need z
just abc()
to the end should be enough.
Yes, just abc() is also working.
I am just trying the ChakraHost Samples and trying different javascript in that.
In that case; there is no issue here. If you want a particular script execution to return something, you may add that to the end.
closing this one. @kinju4374 Thanks for asking.
Thanks for the help. I also have a query, when I use Debug.WriteLine() to check result of the javascript in c#, it doesn't display anything but when I use same in your sample, it gets displayed on TextBlock.
Can you please suggest how to debug javascript code when ChakraHost is used?
Here's a relevant thread for you @kinju4374 https://github.com/Microsoft/ChakraCore/issues/1274.
@liminzhu thanks. This works fine for me. I have one more doubt that it will work in Release/ARM version(which we upload on store) without any issues right?
@kinju4374 no problem. Debugging should work on Release/ARM. I don't personally own an ARM device, but you can try it out.
@liminzhu Yes, I will try. It works when Application Process is set as "Script", but I am asking that when I make app Live on the store, it will work without any problems right? When I change debug to Managed only, then the app starts giving Exception.
When I change debug to Managed only, then the app starts giving Exception.
@kinju4374 can you clarify that? What exceptions are you getting?
@liminzhu I am getting Exception thrown: 'System.Exception' in ChakraBridge.winmd Exception thrown: 'System.Exception' in mscorlib.ni.dll
It is showing same with Release - ARM version which we used to deploy on store. Please suggest.
@liminzhu @obastemur Do we have Nuget Package for this? I have added reference ChakraBridge.winmd from dist folder in my app. Please help me as I need this to load javascript in my c# project.
Exact Exception is Exception thrown: 'System.Exception' in ChakraBridge.winmd failed to start debugging.
ChakraBridge.winmd
Are you referring to this project? This sounds like an implementation issue specific to that project, rather than a Chakra/ChakraCore issue. I'd advise opening an issue on that project.
I added this as reference to use ChakraHost API in my project but it gives exception when debug mode is changed
Close as the same issue is tracked at https://github.com/deltakosh/JsBridge/issues/15.
I am trying to use the following javascript and I am getting an undefined error. Can you please suggest what am I doing wrong.
function a(){ return 10; }; function b(){ return 20; }; function c(){ return 30; }; function abc(){ return a()*b()*c(); }