Exemple #1
0
        public bool Compile(string strScript)
        {
            if (m_vsae != null)
            {
                m_vsae.Close();
                m_vsae = null;
            }

            Init();

            m_vsaciScript.SourceText = WrapUserScript(strScript);
            return(m_vsae.Compile());
        }
Exemple #2
0
        public static xblock GetCodeBlock(string code)
        {
            xblock ret = null;

            Microsoft.JScript.Vsa.VsaEngine engine = new Microsoft.JScript.Vsa.VsaEngine();
            StringWriter sw = new StringWriter();

            engine.InitVsaEngine("test", new VsaSite(sw));
            DocumentContext docContext = new DocumentContext("", engine);
            Context         context    = new Context(docContext, code);
            JSParser        parser     = new JSParser(context);
            Block           block      = parser.ParseEvalBody();

            ret = new xjscript.xblock(block);

            engine.Close();
            // MessageBox.Show(((Completion)block.Evaluate()).value.ToString());

            return(ret);
        }
Exemple #3
0
 public virtual void Dispose()
 {
     engine.Close();
 }