Open haichencheng opened 8 years ago
@haichencheng are you talking about this one? Right you need to supply the script and the path as argument and that isn't clear from the readme. Let me fix this.
I believe the below simple javascript (a nameless function call) - when saved to a test.js
file - illustrates how it works:
( () => {
host.echo('Hello World!');
// host.argument[0] is the .js file.
host.echo("Hello " + host.arguments[1]);
return 0;
} )();
In a command prompt run the test.js script with (here illustrated using the Windows version):
ChakraCoreHost.exe test.js "YourName"
And you should/will see the output:
Hello World!
Hello YourName
0
Sorry for the late update. Added some clarification in readme to make it obvious. https://github.com/Microsoft/Chakra-Samples/commit/42d4bfcaa9406ebf1733ef335eac00b55812c8b6
When I am trying to run the ChakraCoreHost sample project, the instruction
After I stepped through the code, I got that I supposed to provide a path to a js file such as C:\Users\XXX\Desktop\temp\runSimple.js
to exercise the host's function, I create runSimple.js with content: host.runScript('C:/Users/XXX/Desktop/temp/simple.js');
Where simple.js has content: host.echo("wbc",1,2,3);