Closed kokhoor closed 6 years ago
The loading of DLL should be as follows (windows environment use WinDLL)
if os.path.isfile(sys.argv[1]):
if sys.platform == 'win32':
chakraCore = WinDLL(sys.argv[1])
else:
chakraCore = CDLL(sys.argv[1])
# You are expected to call DllMain manually on non-Windows
# Attach process
chakraCore.DllMain(0, 1, 0);
# Attach main thread
chakraCore.DllMain(0, 2, 0);
else:
print("\nFile not found at " + sys.argv[1] + "\n\n")
usage()
Thanks for opening the issue @kokhoor! I updated the sample to reflect the APIs changes we made. https://github.com/Microsoft/Chakra-Samples/commit/99431c3e9c225311fc3ded557ac8f5037894d62b
Anytime! Also just to inform, in Windows, it is: chakraCore = WinDLL(sys.argv[1])
Thanks for prompt action!
After messing around, I am able to run helloWorld.py using Python 2 and Python 3 in OSX on ChakraCore 1.7.3. Code is at the end of this message.
JsCreateStringUtf8
toJsCreateString
andJsCopyStringUtf8
toJsCopyString
because they don't exist anymorechakraCore.JsRun(scriptSource, 0, fname, 0, byref(jsResult));
to:chakraCore.JsRun(scriptSource, 0, fname, 0x02, byref(jsResult));
as 0x02 is for JsParseScriptAttributeArrayBufferIsUtf16EncodedI am assuming should be similar in Linux, will perform testing to see if it works on Windows too.
helloWorld.py: