using System; using Jint.Runtime.Interop; namespace Jint.Native.String { /// /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.5.4 /// public sealed class StringPrototype : StringInstance { private StringPrototype(Engine engine) : base(engine) { } public static StringPrototype CreatePrototypeObject(Engine engine, StringConstructor stringConstructor) { var obj = new StringPrototype(engine); obj.Prototype = engine.Object.PrototypeObject; obj.PrimitiveValue = ""; obj.FastAddProperty("constructor", stringConstructor, false, false, false); return obj; } public void Configure() { FastAddProperty("toString", new ClrFunctionInstance(Engine, ToStringString), false, false, false); FastAddProperty("valueOf", new ClrFunctionInstance(Engine, ValueOf), false, false, false); FastAddProperty("charAt", new ClrFunctionInstance(Engine, CharAt), false, false, false); FastAddProperty("charCodeAt", new ClrFunctionInstance(Engine, CharCodeAt), false, false, false); FastAddProperty("concat", new ClrFunctionInstance(Engine, Concat), false, false, false); FastAddProperty("indexOf", new ClrFunctionInstance(Engine, IndexOf), false, false, false); FastAddProperty("lastIndexOf", new ClrFunctionInstance(Engine, LastIndexOf), false, false, false); FastAddProperty("localeCompare", new ClrFunctionInstance(Engine, LocaleCompare), false, false, false); FastAddProperty("match", new ClrFunctionInstance(Engine, Match), false, false, false); FastAddProperty("replace", new ClrFunctionInstance(Engine, Replace), false, false, false); FastAddProperty("search", new ClrFunctionInstance(Engine, Search), false, false, false); FastAddProperty("slice", new ClrFunctionInstance(Engine, Slice), false, false, false); FastAddProperty("split", new ClrFunctionInstance(Engine, Split), false, false, false); FastAddProperty("substring", new ClrFunctionInstance(Engine, Substring), false, false, false); FastAddProperty("toLowerCase", new ClrFunctionInstance(Engine, ToLowerCase), false, false, false); FastAddProperty("toLocaleLowerCase", new ClrFunctionInstance(Engine, ToLocaleLowerCase), false, false, false); FastAddProperty("toUpperCase", new ClrFunctionInstance(Engine, ToUpperCase), false, false, false); FastAddProperty("toLocaleUpperCase", new ClrFunctionInstance(Engine, ToLocaleUpperCase), false, false, false); FastAddProperty("trim", new ClrFunctionInstance(Engine, Trim), false, false, false); } private object Trim(object arg1, object[] arg2) { throw new NotImplementedException(); } private object ToLocaleUpperCase(object arg1, object[] arg2) { throw new NotImplementedException(); } private object ToUpperCase(object arg1, object[] arg2) { throw new NotImplementedException(); } private object ToLocaleLowerCase(object arg1, object[] arg2) { throw new NotImplementedException(); } private object ToLowerCase(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Substring(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Split(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Slice(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Search(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Replace(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Match(object arg1, object[] arg2) { throw new NotImplementedException(); } private object LocaleCompare(object arg1, object[] arg2) { throw new NotImplementedException(); } private object LastIndexOf(object arg1, object[] arg2) { throw new NotImplementedException(); } private object IndexOf(object arg1, object[] arg2) { throw new NotImplementedException(); } private object Concat(object arg1, object[] arg2) { throw new NotImplementedException(); } private object CharCodeAt(object arg1, object[] arg2) { throw new NotImplementedException(); } private object CharAt(object arg1, object[] arg2) { throw new NotImplementedException(); } private object ValueOf(object arg1, object[] arg2) { throw new NotImplementedException(); } private object ToStringString(object arg1, object[] arg2) { throw new NotImplementedException(); } } }