public static Maps Create(Schema baseSchema) { var maps = new Maps(); maps.Base = baseSchema; maps.Array = baseSchema.SubClass("length"); maps.Function = baseSchema.SubClass(new[] { "length", "prototype" }); maps.Prototype = baseSchema.SubClass("constructor"); maps.String = baseSchema.SubClass("length"); maps.Number = baseSchema; maps.Boolean = baseSchema; maps.RegExp = baseSchema.SubClass(new[] { "source", "global", "ignoreCase", "multiline", "lastIndex" }); return(maps); }
public virtual Schema SubClass(IEnumerable <string> names) { Schema schema = this; foreach (var name in names) { schema = schema.SubClass(name); } return(schema); }