コード例 #1
0
        public void SUndefinedTranslateTest()
        {
            var processor = ScriptProcessorFactory.GetNew();

            SUndefined Undefined = (SUndefined)processor.Undefined;

            var obj = ScriptOutAdapter.Translate(Undefined);

            Assert.IsTrue(obj is SUndefined);
        }
コード例 #2
0
ファイル: ScriptContext.cs プロジェクト: JoNMii/Pokemon3D
        internal void Initialize()
        {
            if (Parent == null)
            {
                AddVariable(SObject.LITERAL_UNDEFINED, SUndefined.Factory(), true);
                AddVariable(SObject.LITERAL_NULL, SNull.Factory(), true);

                AddPrototype(new ObjectPrototype());
                AddPrototype(new BooleanPrototype());
                AddPrototype(new NumberPrototype());
                AddPrototype(new StringPrototype(_processor));
                AddPrototype(new ArrayPrototype());
                AddPrototype(new ErrorPrototype(_processor));

                GlobalFunctions.GetFunctions()
                .ForEach(AddVariable);
            }
        }