Inheritance: Jint.Native.JsConstructor
Beispiel #1
0
        public JsGlobal(ExecutionVisitor visitor, Options options)
        {
            this.Options = options;
            this.Visitor = visitor;

            this["null"] = JsNull.Instance;

            #region Global Classes
            this["Object"] = ObjectClass = new JsObjectConstructor(this);
            this["Function"] = FunctionClass = new JsFunctionConstructor(this);
            this["Array"] = ArrayClass = new JsArrayConstructor(this);
            this["Boolean"] = BooleanClass = new JsBooleanConstructor(this);
            this["Date"] = DateClass = new JsDateConstructor(this);

            this["Error"] = ErrorClass = new JsErrorConstructor(this, "Error");
            this["EvalError"] = EvalErrorClass = new JsErrorConstructor(this, "EvalError");
            this["RangeError"] = RangeErrorClass = new JsErrorConstructor(this, "RangeError");
            this["ReferenceError"] = ReferenceErrorClass = new JsErrorConstructor(this, "ReferenceError");
            this["SyntaxError"] = SyntaxErrorClass = new JsErrorConstructor(this, "SyntaxError");
            this["TypeError"] = TypeErrorClass = new JsErrorConstructor(this, "TypeError");
            this["URIError"] = URIErrorClass = new JsErrorConstructor(this, "URIError");

            this["Number"] = NumberClass = new JsNumberConstructor(this);
            this["RegExp"] = RegExpClass = new JsRegExpConstructor(this);
            this["String"] = StringClass = new JsStringConstructor(this);
            this["Math"] = MathClass = new JsMathConstructor(this);
            this.Prototype = ObjectClass.Prototype;
            #endregion


            MathClass.Prototype = ObjectClass.Prototype;

            foreach (JsInstance c in this.GetValues())
            {
                if (c is JsConstructor)
                {
                    ((JsConstructor)c).InitPrototype(this);
                }
            }

            #region Global Properties
            this["NaN"] = NumberClass["NaN"];  // 15.1.1.1
            this["Infinity"] = NumberClass["POSITIVE_INFINITY"]; // // 15.1.1.2
            this["undefined"] = JsUndefined.Instance; // 15.1.1.3
            this[JsInstance.THIS] = this;
            #endregion

            #region Global Functions
            this["eval"] = new JsFunctionWrapper(Eval); // 15.1.2.1
            this["parseInt"] = new JsFunctionWrapper(ParseInt); // 15.1.2.2
            this["parseFloat"] = new JsFunctionWrapper(ParseFloat); // 15.1.2.3
            this["isNaN"] = new JsFunctionWrapper(IsNaN);
            this["isFinite"] = new JsFunctionWrapper(isFinite);
            this["decodeURI"] = new JsFunctionWrapper(DecodeURI);
            this["encodeURI"] = new JsFunctionWrapper(EncodeURI);
            this["decodeURIComponent"] = new JsFunctionWrapper(DecodeURIComponent);
            this["encodeURIComponent"] = new JsFunctionWrapper(EncodeURIComponent);
            #endregion

        }
Beispiel #2
0
        /// <summary>
        /// Converts a JsInstance object to its CLR equivalence
        /// </summary>
        /// <param name="parameter">The object to convert</param>
        /// <returns>A CLR object</returns>
        public static object ConvertParameter(JsInstance parameter)
        {
            if (parameter == null)
            {
                return(null);
            }

            if (parameter.Class != JsFunction.TYPEOF && parameter.Class != JsArray.TYPEOF)
            {
                return(parameter.Value);
            }

            if (parameter == JsNull.Instance)
            {
                return(null);
            }

            if (parameter.IsClr)
            {
                return(parameter.Value);
            }

            var constructor = ((JsDictionaryObject)parameter)["constructor"] as JsFunction;

            if (constructor == null)
            {
                return(parameter);
            }
            switch (constructor.Name)
            {
            case "Date":
                return(JsDateConstructor.CreateDateTime(parameter.ToNumber()));

            case "String":
            case "RegExp":
            case "Number":
                return(parameter.Value);

            case "Array":
            case "Object":
                if (parameter.Class == JsFunction.TYPEOF)
                {
                    return(parameter);
                }
                var array = new object[((JsObject)parameter).Length];
                foreach (KeyValuePair <string, JsInstance> key in (JsObject)parameter)
                {
                    int index;
                    if (int.TryParse(key.Key, out index))
                    {
                        array[index] = ConvertParameters(key.Value)[0];
                    }
                }
                return(new System.Collections.ArrayList(array));

            default:
                return(parameter);
            }
        }
        public JsGlobal(ExecutionVisitor visitor, Options options)
        {
            this.Options = options;
            this.Visitor = visitor;

            this["null"] = JsNull.Instance;

            #region Global Classes
            this["Object"]   = ObjectClass = new JsObjectConstructor(this);
            this["Function"] = FunctionClass = new JsFunctionConstructor(this);
            this["Array"]    = ArrayClass = new JsArrayConstructor(this);
            this["Boolean"]  = BooleanClass = new JsBooleanConstructor(this);
            this["Date"]     = DateClass = new JsDateConstructor(this);

            this["Error"]          = ErrorClass = new JsErrorConstructor(this, "Error");
            this["EvalError"]      = EvalErrorClass = new JsErrorConstructor(this, "EvalError");
            this["RangeError"]     = RangeErrorClass = new JsErrorConstructor(this, "RangeError");
            this["ReferenceError"] = ReferenceErrorClass = new JsErrorConstructor(this, "ReferenceError");
            this["SyntaxError"]    = SyntaxErrorClass = new JsErrorConstructor(this, "SyntaxError");
            this["TypeError"]      = TypeErrorClass = new JsErrorConstructor(this, "TypeError");
            this["URIError"]       = URIErrorClass = new JsErrorConstructor(this, "URIError");

            this["Number"] = NumberClass = new JsNumberConstructor(this);
            this["RegExp"] = RegExpClass = new JsRegExpConstructor(this);
            this["String"] = StringClass = new JsStringConstructor(this);
            this["Math"]   = MathClass = new JsMathConstructor(this);
            this.Prototype = ObjectClass.Prototype;
            #endregion


            MathClass.Prototype = ObjectClass.Prototype;

            foreach (JsInstance c in this.GetValues())
            {
                if (c is JsConstructor)
                {
                    ((JsConstructor)c).InitPrototype(this);
                }
            }

            #region Global Properties
            this["NaN"]           = NumberClass["NaN"];               // 15.1.1.1
            this["Infinity"]      = NumberClass["POSITIVE_INFINITY"]; // // 15.1.1.2
            this["undefined"]     = JsUndefined.Instance;             // 15.1.1.3
            this[JsInstance.THIS] = this;
            #endregion

            #region Global Functions
            this["eval"]               = new JsFunctionWrapper(Eval);       // 15.1.2.1
            this["parseInt"]           = new JsFunctionWrapper(ParseInt);   // 15.1.2.2
            this["parseFloat"]         = new JsFunctionWrapper(ParseFloat); // 15.1.2.3
            this["isNaN"]              = new JsFunctionWrapper(IsNaN);
            this["isFinite"]           = new JsFunctionWrapper(isFinite);
            this["decodeURI"]          = new JsFunctionWrapper(DecodeURI);
            this["encodeURI"]          = new JsFunctionWrapper(EncodeURI);
            this["decodeURIComponent"] = new JsFunctionWrapper(DecodeURIComponent);
            this["encodeURIComponent"] = new JsFunctionWrapper(EncodeURIComponent);
            #endregion
        }
Beispiel #4
0
 public JsInstance ToUTCStringImpl(JsDictionaryObject target, JsInstance[] parameters)
 {
     if (double.IsNaN(target.ToNumber()))
     {
         return((JsInstance)this.Global.StringClass.New(double.NaN.ToString()));
     }
     return((JsInstance)this.Global.StringClass.New(JsDateConstructor.CreateDateTime(target.ToNumber()).ToString(JsDate.FORMATUTC, (IFormatProvider)CultureInfo.InvariantCulture)));
 }
Beispiel #5
0
        public JsInstance SetUTCDateImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (parameters.Length == 0)
            {
                throw new ArgumentException("There was no date specified");
            }
            DateTime dateTime = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime     = dateTime.AddDays((double)-dateTime.Day);
            dateTime     = dateTime.AddDays(parameters[0].ToNumber());
            target.Value = (object)dateTime;
            return((JsInstance)target);
        }
Beispiel #6
0
        public JsInstance ToTimeStringImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return((JsInstance)this.Global.StringClass.New(double.NaN.ToString()));
            }
            JsStringConstructor stringClass = this.Global.StringClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToLocalTime();
            string str = dateTime.ToString(JsDate.TIMEFORMAT, (IFormatProvider)CultureInfo.InvariantCulture);

            return((JsInstance)stringClass.New(str));
        }
Beispiel #7
0
        public JsInstance GetSecondsImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return(this.Global.NaN);
            }
            JsNumberConstructor numberClass = this.Global.NumberClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToLocalTime();
            double second = (double)dateTime.Second;

            return((JsInstance)numberClass.New(second));
        }
Beispiel #8
0
        public JsInstance GetUTCHoursImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return(this.Global.NaN);
            }
            JsNumberConstructor numberClass = this.Global.NumberClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToUniversalTime();
            double hour = (double)dateTime.Hour;

            return((JsInstance)numberClass.New(hour));
        }
Beispiel #9
0
        public JsInstance SetUTCMillisecondsImpl(
            JsDictionaryObject target,
            JsInstance[] parameters)
        {
            if (parameters.Length == 0)
            {
                throw new ArgumentException("There was no millisecond specified");
            }
            DateTime dateTime = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime     = dateTime.AddMilliseconds((double)-dateTime.Millisecond);
            dateTime     = dateTime.AddMilliseconds(parameters[0].ToNumber());
            target.Value = (object)this.New(dateTime).ToNumber();
            return((JsInstance)target);
        }
Beispiel #10
0
        public JsInstance ToLocaleDateStringImpl(
            JsDictionaryObject target,
            JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return((JsInstance)this.Global.StringClass.New(double.NaN.ToString()));
            }
            JsStringConstructor stringClass = this.Global.StringClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToLocalTime();
            string str = dateTime.ToString(JsDate.DATEFORMAT);

            return((JsInstance)stringClass.New(str));
        }
Beispiel #11
0
        public JsInstance SetFullYearImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (parameters.Length == 0)
            {
                throw new ArgumentException("There was no year specified");
            }
            DateTime dateTime = JsDateConstructor.CreateDateTime(target.ToNumber()).ToLocalTime();
            int      num      = dateTime.Year - (int)parameters[0].ToNumber();

            dateTime     = dateTime.AddYears(-num);
            target.Value = (object)dateTime;
            if (parameters.Length > 1)
            {
                JsInstance[] parameters1 = new JsInstance[parameters.Length - 1];
                parameters.CopyTo((Array)parameters1, 1);
                target = (JsDictionaryObject)this.SetMonthImpl(target, parameters1);
            }
            return((JsInstance)target);
        }
Beispiel #12
0
        public JsInstance SetHoursImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (parameters.Length == 0)
            {
                throw new ArgumentException("There was no hour specified");
            }
            DateTime dateTime = JsDateConstructor.CreateDateTime(target.ToNumber()).ToLocalTime();

            dateTime     = dateTime.AddHours((double)-dateTime.Hour);
            dateTime     = dateTime.AddHours(parameters[0].ToNumber());
            target.Value = (object)dateTime;
            if (parameters.Length > 1)
            {
                JsInstance[] parameters1 = new JsInstance[parameters.Length - 1];
                parameters.CopyTo((Array)parameters1, 1);
                target = (JsDictionaryObject)this.SetMinutesImpl(target, parameters1);
            }
            return((JsInstance)target);
        }
Beispiel #13
0
        public JsInstance SetUTCMonthImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (parameters.Length == 0)
            {
                throw new ArgumentException("There was no month specified");
            }
            DateTime dateTime = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime     = dateTime.AddMonths(-dateTime.Month);
            dateTime     = dateTime.AddMonths((int)parameters[0].ToNumber());
            target.Value = (object)dateTime;
            if (parameters.Length > 1)
            {
                JsInstance[] parameters1 = new JsInstance[parameters.Length - 1];
                parameters.CopyTo((Array)parameters1, 1);
                target = (JsDictionaryObject)this.SetDateImpl(target, parameters1);
            }
            return((JsInstance)target);
        }
Beispiel #14
0
 public override object ToObject()
 {
     return(JsDateConstructor.CreateDateTime(value).ToLocalTime());
 }
Beispiel #15
0
        public JsGlobal(ExecutionVisitor visitor, Options options)
            : base(JsNull.Instance)
        {
            this.Options = options;
            this.Visitor = visitor;

            this["null"] = JsNull.Instance;
            JsObject objectProrotype = new JsObject(JsNull.Instance);

            JsFunction functionPrototype = new JsFunctionWrapper(
                delegate(JsInstance[] arguments) {
                    return JsUndefined.Instance;
                },
                objectProrotype
            );

            Marshaller = new Marshaller(this);

            #region Global Classes
            this["Function"] = FunctionClass = new JsFunctionConstructor(this, functionPrototype);
            this["Object"] = ObjectClass = new JsObjectConstructor(this, functionPrototype, objectProrotype);
            ObjectClass.InitPrototype(this);

            this["Array"] = ArrayClass = new JsArrayConstructor(this);
            this["Boolean"] = BooleanClass = new JsBooleanConstructor(this);
            this["Date"] = DateClass = new JsDateConstructor(this);

            this["Error"] = ErrorClass = new JsErrorConstructor(this, "Error");
            this["EvalError"] = EvalErrorClass = new JsErrorConstructor(this, "EvalError");
            this["RangeError"] = RangeErrorClass = new JsErrorConstructor(this, "RangeError");
            this["ReferenceError"] = ReferenceErrorClass = new JsErrorConstructor(this, "ReferenceError");
            this["SyntaxError"] = SyntaxErrorClass = new JsErrorConstructor(this, "SyntaxError");
            this["TypeError"] = TypeErrorClass = new JsErrorConstructor(this, "TypeError");
            this["URIError"] = URIErrorClass = new JsErrorConstructor(this, "URIError");

            this["Number"] = NumberClass = new JsNumberConstructor(this);
            this["RegExp"] = RegExpClass = new JsRegExpConstructor(this);
            this["String"] = StringClass = new JsStringConstructor(this);
            this["Math"] = MathClass = new JsMathConstructor(this);

            // 15.1 prototype of the global object varies on the implementation
            //this.Prototype = ObjectClass.PrototypeProperty;
            #endregion

            foreach (JsInstance c in this.GetValues()) {
                if (c is JsConstructor) {
                    ((JsConstructor)c).InitPrototype(this);
                }
            }

            #region Global Properties
            this["NaN"] = NumberClass["NaN"];  // 15.1.1.1
            this["Infinity"] = NumberClass["POSITIVE_INFINITY"]; // // 15.1.1.2
            this["undefined"] = JsUndefined.Instance; // 15.1.1.3
            this[JsScope.THIS] = this;
            #endregion

            #region Global Functions
            // every embed function should have a prototype FunctionClass.PrototypeProperty - 15.
            this["eval"] = new JsFunctionWrapper(Eval, FunctionClass.PrototypeProperty); // 15.1.2.1
            this["parseInt"] = new JsFunctionWrapper(ParseInt, FunctionClass.PrototypeProperty); // 15.1.2.2
            this["parseFloat"] = new JsFunctionWrapper(ParseFloat, FunctionClass.PrototypeProperty); // 15.1.2.3
            this["isNaN"] = new JsFunctionWrapper(IsNaN, FunctionClass.PrototypeProperty);
            this["isFinite"] = new JsFunctionWrapper(isFinite, FunctionClass.PrototypeProperty);
            this["decodeURI"] = new JsFunctionWrapper(DecodeURI, FunctionClass.PrototypeProperty);
            this["encodeURI"] = new JsFunctionWrapper(EncodeURI, FunctionClass.PrototypeProperty);
            this["decodeURIComponent"] = new JsFunctionWrapper(DecodeURIComponent, FunctionClass.PrototypeProperty);
            this["encodeURIComponent"] = new JsFunctionWrapper(EncodeURIComponent, FunctionClass.PrototypeProperty);
            #endregion

            Marshaller.InitTypes();
        }
Beispiel #16
0
 public override string ToString()
 {
     return(JsDateConstructor.CreateDateTime(value).ToLocalTime().ToString(FORMAT, CultureInfo.InvariantCulture));
 }
Beispiel #17
0
 public JsDate(double value, JsObject prototype)
     : this(JsDateConstructor.CreateDateTime(value), prototype)
 {
 }
Beispiel #18
0
        public JsGlobal(ExecutionVisitor visitor, Options options)
            : base(JsNull.Instance)
        {
            this.Options = options;
            this.Visitor = visitor;

            this["null"] = JsNull.Instance;
            JsObject objectProrotype = new JsObject(JsNull.Instance);

            JsFunction functionPrototype = new JsFunctionWrapper(
                delegate(JsInstance[] arguments) {
                return(JsUndefined.Instance);
            },
                objectProrotype
                );

            Marshaller = new Marshaller(this);

            #region Global Classes
            this["Function"] = FunctionClass = new JsFunctionConstructor(this, functionPrototype);
            this["Object"]   = ObjectClass = new JsObjectConstructor(this, functionPrototype, objectProrotype);
            ObjectClass.InitPrototype(this);


            this["Array"]   = ArrayClass = new JsArrayConstructor(this);
            this["Boolean"] = BooleanClass = new JsBooleanConstructor(this);
            this["Date"]    = DateClass = new JsDateConstructor(this);

            this["Error"]          = ErrorClass = new JsErrorConstructor(this, "Error");
            this["EvalError"]      = EvalErrorClass = new JsErrorConstructor(this, "EvalError");
            this["RangeError"]     = RangeErrorClass = new JsErrorConstructor(this, "RangeError");
            this["ReferenceError"] = ReferenceErrorClass = new JsErrorConstructor(this, "ReferenceError");
            this["SyntaxError"]    = SyntaxErrorClass = new JsErrorConstructor(this, "SyntaxError");
            this["TypeError"]      = TypeErrorClass = new JsErrorConstructor(this, "TypeError");
            this["URIError"]       = URIErrorClass = new JsErrorConstructor(this, "URIError");

            this["Number"] = NumberClass = new JsNumberConstructor(this);
            this["RegExp"] = RegExpClass = new JsRegExpConstructor(this);
            this["String"] = StringClass = new JsStringConstructor(this);
            this["Math"]   = MathClass = new JsMathConstructor(this);

            // 15.1 prototype of the global object varies on the implementation
            //this.Prototype = ObjectClass.PrototypeProperty;
            #endregion


            foreach (JsInstance c in this.GetValues())
            {
                if (c is JsConstructor)
                {
                    ((JsConstructor)c).InitPrototype(this);
                }
            }

            #region Global Properties
            this["NaN"]        = NumberClass["NaN"];               // 15.1.1.1
            this["Infinity"]   = NumberClass["POSITIVE_INFINITY"]; // // 15.1.1.2
            this["undefined"]  = JsUndefined.Instance;             // 15.1.1.3
            this[JsScope.THIS] = this;
            #endregion

            #region Global Functions
            // every embed function should have a prototype FunctionClass.PrototypeProperty - 15.
            this["eval"]               = new JsFunctionWrapper(Eval, FunctionClass.PrototypeProperty);       // 15.1.2.1
            this["parseInt"]           = new JsFunctionWrapper(ParseInt, FunctionClass.PrototypeProperty);   // 15.1.2.2
            this["parseFloat"]         = new JsFunctionWrapper(ParseFloat, FunctionClass.PrototypeProperty); // 15.1.2.3
            this["isNaN"]              = new JsFunctionWrapper(IsNaN, FunctionClass.PrototypeProperty);
            this["isFinite"]           = new JsFunctionWrapper(isFinite, FunctionClass.PrototypeProperty);
            this["decodeURI"]          = new JsFunctionWrapper(DecodeURI, FunctionClass.PrototypeProperty);
            this["encodeURI"]          = new JsFunctionWrapper(EncodeURI, FunctionClass.PrototypeProperty);
            this["decodeURIComponent"] = new JsFunctionWrapper(DecodeURIComponent, FunctionClass.PrototypeProperty);
            this["encodeURIComponent"] = new JsFunctionWrapper(EncodeURIComponent, FunctionClass.PrototypeProperty);
            #endregion

            Marshaller.InitTypes();
        }
Beispiel #19
0
        public JsGlobal(IJintVisitor visitor, Options options)
        {
            this.Options = options;
            this.Visitor = visitor;

            this["null"] = JsNull.Instance;

            #region Global Classes
            this["Object"] = ObjectClass = new JsObjectConstructor(this);
            this["Function"] = FunctionClass = new JsFunctionConstructor(this);
            this["Array"] = ArrayClass = new JsArrayConstructor(this);
            this["Boolean"] = BooleanClass = new JsBooleanConstructor(this);
            this["Date"] = DateClass = new JsDateConstructor(this); // overriten by 1C function

            this["Error"] = ErrorClass = new JsErrorConstructor(this, "Error");
            this["EvalError"] = EvalErrorClass = new JsErrorConstructor(this, "EvalError");
            this["RangeError"] = RangeErrorClass = new JsErrorConstructor(this, "RangeError");
            this["ReferenceError"] = ReferenceErrorClass = new JsErrorConstructor(this, "ReferenceError");
            this["SyntaxError"] = SyntaxErrorClass = new JsErrorConstructor(this, "SyntaxError");
            this["TypeError"] = TypeErrorClass = new JsErrorConstructor(this, "TypeError");
            this["URIError"] = URIErrorClass = new JsErrorConstructor(this, "URIError");

            this["Number"] = NumberClass = new JsNumberConstructor(this);
            this["RegExp"] = RegExpClass = new JsRegExpConstructor(this);
            this["String"] = StringClass = new JsStringConstructor(this);
            this["Math"] = MathClass = new JsMathConstructor(this);
            this.Prototype = ObjectClass.Prototype;
            #endregion


            MathClass.Prototype = ObjectClass.Prototype;

            foreach (JsInstance c in this.GetValues())
            {
                if (c is JsConstructor)
                {
                    ((JsConstructor)c).InitPrototype(this);
                }
            }

            #region Global Properties
            this["NaN"] = NumberClass["NaN"];  // 15.1.1.1
            this["Infinity"] = NumberClass["POSITIVE_INFINITY"]; // // 15.1.1.2
            this["undefined"] = JsUndefined.Instance; // 15.1.1.3
            this[JsInstance.THIS] = this;
            #endregion

            #region Global Functions
            this["eval"] = new JsFunctionWrapper(Eval); // 15.1.2.1
            this["parseInt"] = new JsFunctionWrapper(ParseInt); // 15.1.2.2
            this["parseFloat"] = new JsFunctionWrapper(ParseFloat); // 15.1.2.3
            this["getType"] = new JsFunctionWrapper(GetType); // AVKugushev
            this["isDefault"] = new JsFunctionWrapper(IsDefault); // AVKugushev
            this["enumToString"] = new JsFunctionWrapper(EnumToString); // AVKugushev
            this["enumToInt"] = new JsFunctionWrapper(EnumToInt); // AVKugushev
            this["validate"] = new JsFunctionWrapper(Validate); // AVKugushev
            this["isNaN"] = new JsFunctionWrapper(IsNaN);
            this["isFinite"] = new JsFunctionWrapper(isFinite);
            this["decodeURI"] = new JsFunctionWrapper(DecodeURI);
            this["encodeURI"] = new JsFunctionWrapper(EncodeURI);
            this["decodeURIComponent"] = new JsFunctionWrapper(DecodeURIComponent);
            this["encodeURIComponent"] = new JsFunctionWrapper(EncodeURIComponent);

            // 1C functions
            // Functions for working with String type values
            this["StrLen"] = new JsFunctionWrapper(StrLen);
            this["TrimL"] = new JsFunctionWrapper(TrimL);
            this["TrimR"] = new JsFunctionWrapper(TrimR);
            this["TrimAll"] = new JsFunctionWrapper(TrimAll);
            this["Left"] = new JsFunctionWrapper(Left);
            this["Right"] = new JsFunctionWrapper(Right);
            this["Mid"] = new JsFunctionWrapper(Mid);
            this["Find"] = new JsFunctionWrapper(Find);
            this["Upper"] = new JsFunctionWrapper(Upper);
            this["Lower"] = new JsFunctionWrapper(Lower);
            this["Char"] = new JsFunctionWrapper(Char);
            this["CharCode"] = new JsFunctionWrapper(CharCode);
            this["IsBlankString"] = new JsFunctionWrapper(IsBlankString);
            this["StrReplace"] = new JsFunctionWrapper(StrReplace);
            this["StrLineCount"] = new JsFunctionWrapper(StrLineCount);
            this["StrGetLine"] = new JsFunctionWrapper(StrGetLine);
            this["StrOccurrenceCount"] = new JsFunctionWrapper(StrOccurrenceCount);
            this["Title"] = new JsFunctionWrapper(Title);
            // Functions for working with Number type values
            this["Int"] = new JsFunctionWrapper(Int);
            this["Round"] = new JsFunctionWrapper(Round);
            this["Log"] = new JsFunctionWrapper(Log);
            this["Log10"] = new JsFunctionWrapper(Log10);
            this["Sin"] = new JsFunctionWrapper(Sin);
            this["Cos"] = new JsFunctionWrapper(Cos);
            this["Tan"] = new JsFunctionWrapper(Tan);
            this["ASin"] = new JsFunctionWrapper(ASin);
            this["ACos"] = new JsFunctionWrapper(ACos);
            this["ATan"] = new JsFunctionWrapper(ATan);
            this["Exp"] = new JsFunctionWrapper(Exp);
            this["Pow"] = new JsFunctionWrapper(Pow);
            this["Sqrt"] = new JsFunctionWrapper(Sqrt);
            // Functions for working with Date type values
            this["Year"] = new JsFunctionWrapper(Year);
            this["Month"] = new JsFunctionWrapper(Month);
            this["Day"] = new JsFunctionWrapper(Day);
            this["Hour"] = new JsFunctionWrapper(Hour);
            this["Minute"] = new JsFunctionWrapper(Minute);
            this["Second"] = new JsFunctionWrapper(Second);
            this["BegOfYear"] = new JsFunctionWrapper(BegOfYear);
            this["BegOfQuarter"] = new JsFunctionWrapper(BegOfQuarter);
            this["BegOfMonth"] = new JsFunctionWrapper(BegOfMonth);
            this["BegOfWeek"] = new JsFunctionWrapper(BegOfWeek);
            this["BegOfDay"] = new JsFunctionWrapper(BegOfDay);
            this["BegOfHour"] = new JsFunctionWrapper(BegOfHour);
            this["BegOfMinute"] = new JsFunctionWrapper(BegOfMinute);
            this["EndOfYear"] = new JsFunctionWrapper(EndOfYear);
            this["EndOfQuarter"] = new JsFunctionWrapper(EndOfQuarter);
            this["EndOfMonth"] = new JsFunctionWrapper(EndOfMonth);
            this["EndOfWeek"] = new JsFunctionWrapper(EndOfWeek);
            this["EndOfDay"] = new JsFunctionWrapper(EndOfDay);
            this["EndOfHour"] = new JsFunctionWrapper(EndOfHour);
            this["EndOfMinute"] = new JsFunctionWrapper(EndOfMinute);
            this["WeekOfYear"] = new JsFunctionWrapper(WeekOfYear);
            this["DayOfYear"] = new JsFunctionWrapper(DayOfYear);
            this["WeekDay"] = new JsFunctionWrapper(WeekDay);
            this["AddMonth"] = new JsFunctionWrapper(AddMonth);
            this["CurrentDate"] = new JsFunctionWrapper(CurrentDate);
            // Value conversion functions
            this["Boolean"] = new JsFunctionWrapper(Boolean);
            this["Number"] = new JsFunctionWrapper(Number);
            this["String"] = new JsFunctionWrapper(String);
            this["Date"] = new JsFunctionWrapper(Date);
            // Formatting functions
            this["Format"] = new JsFunctionWrapper(Format);
            // Others
            this["Type"] = new JsFunctionWrapper(Type);
            this["TypeOf"] = new JsFunctionWrapper(TypeOf);
            this["Min"] = new JsFunctionWrapper(Min);
            this["Max"] = new JsFunctionWrapper(Max);
            this["ErrorDescription"] = new JsFunctionWrapper(ErrorDescription);
            this["Eval"] = new JsFunctionWrapper(Eval1C);
            this["ErrorInfo"] = new JsFunctionWrapper(ErrorInfo);
            this["ToString"] = new JsFunctionWrapper(String);
            #endregion
        }