Exemple #1
0
        public void VBScriptEngine_AddRestrictedHostObject_BaseClass()
        {
            var host = new ExtendedHostFunctions() as HostFunctions;

            engine.AddRestrictedHostObject("host", host);
            Assert.IsInstanceOfType(engine.Evaluate("host.newObj()"), typeof(PropertyBag));
            TestUtil.AssertException <ScriptEngineException>(() => engine.Evaluate("host.type(\"System.Int32\")"));
        }
Exemple #2
0
 public void TestInitialize()
 {
     engine = new V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging);
     engine.AddHostObject("host", host = new ExtendedHostFunctions());
 }
 public void VBScriptEngine_AddRestrictedHostObject_BaseClass()
 {
     var host = new ExtendedHostFunctions() as HostFunctions;
     engine.AddRestrictedHostObject("host", host);
     Assert.IsInstanceOfType(engine.Evaluate("host.newObj()"), typeof(PropertyBag));
     TestUtil.AssertException<ScriptEngineException>(() => engine.Evaluate("host.type(\"System.Int32\")"));
 }
Exemple #4
0
 public void TestInitialize()
 {
     engine = new JScriptEngine(WindowsScriptEngineFlags.EnableDebugging);
     engine.DisableCaseInsensitivePropertyLookups = true;
     engine.AddHostObject("host", host            = new ExtendedHostFunctions());
 }