Beispiel #1
0
        public void SNullTranslateTest()
        {
            var processor = ScriptProcessorFactory.GetNew();

            SNull Null = (SNull)processor.Null;

            var obj = ScriptOutAdapter.Translate(Null);

            Assert.IsTrue(obj == null);
        }
Beispiel #2
0
        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);
            }
        }