Ejemplo n.º 1
0
        public void SUndefinedTranslateTest()
        {
            var processor = ScriptProcessorFactory.GetNew();

            SUndefined Undefined = (SUndefined)processor.Undefined;

            var obj = ScriptOutAdapter.Translate(Undefined);

            Assert.IsTrue(obj is SUndefined);
        }
Ejemplo n.º 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);
            }
        }