سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top