Esempio n. 1
0
        public void ScopingExample_TestingVariable()
        {
            IScriptContext context = new ScriptContext();
              context.SetFunction<DefinedFunction>("Defined");

              object resultVal =
               Script.RunCode(
               @"
               x = 0;

               function g() { Defined('x'); }

               return g();
              ", context);

              Assert.IsTrue((bool)resultVal);
        }