0

When running the jsc command on the terminal, I have access to the function print(). It simply logs to stdout.

I'm building a framework to make a JS library available in C and an exception is thrown when my JS source tries to call print(). console.log does not exist, either.

Is catching and printing exceptions the only way to get output from JavaScriptCore when used in a C program?

Khakionion
  • 742
  • 7
  • 20
  • [JavaScriptCore console.log](http://stackoverflow.com/questions/19649932/javascriptcore-console-log/21325240#21325240) has a solution. – 0xced Feb 18 '15 at 14:53

1 Answers1

0

Neither print nor the console object exist if you're using the JavaScriptCore framework directly. You have to build those objects yourself. All you get for free is the a base JavaScript (ECMAScript) implementation.

Doug Richardson
  • 10,483
  • 6
  • 51
  • 77
  • Thanks. I knew those objects didn't exist, but didn't know if I had to make a function available, or if something else was available. – Khakionion May 07 '13 at 21:22