Chakra: IActiveScript::GetScriptDispatch() fails with E_OUTOFMEMORY
-
Hi all, When using jscipt9 (Chakra) from C++ with the
AddNamedItem()
/GetScriptDispatch()
functionality to create a module-like behaviour (context separation) I getE_OUTOFMEMORY
fromGetScriptDispatch()
. This happens only when omitting theSCRIPTITEM_GLOBALMEMBERS
flag withAddNamedItem()
, no matter what other flags are given. I tried already everything, including different flags (all possible flags, not only the known ones), changing the order of calls toIActiveScript
, calling it in different states of the script engine, invoking different versions viaSCRIPTPROP_INVOKEVERSIONING
, implementing all requested interfaces in myIActiveScriptSite
etc - no result. For older versions (means: not using jscript9) of jscript everything works as expected. But as soon as I switch theCLSID
to Chakra it breaks. I posted already on msdn: "AddNamedItem() / GetScriptDispatch() broken in jscript9?" [^] and filed a bug report [^]. You can reproduce with a most simple sample I put on github: https://github.com/IUnknown68/ascptest [^] My main questions is: Am I doing something wrong? Is there something undocumented I have to do? Or is it really a bug? Thanks, imagiro Edit: Run the sample from the command line with 9 as argument to invoke chakra. Otherwise the old jscript engine will be used.