Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Provide sample js script and command line input for ChakraCoreHost sample #41

Open
haichencheng opened this issue Sep 10, 2016 · 3 comments

Comments

@haichencheng
Copy link

When I am trying to run the ChakraCoreHost sample project, the instruction
5. Run the sample by pressing Ctrl+F5 or using Debug > Start Without Debugging.
is not correct.

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);

@liminzhu
Copy link
Member

@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.

@misuo
Copy link

misuo commented Mar 8, 2017

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

@liminzhu
Copy link
Member

Sorry for the late update. Added some clarification in readme to make it obvious. 42d4bfc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants