@@ -226,7 +226,6 @@ private BuiltinFunctionValue ArrayFunction(out ExpandoValue arrayPrototype) {
226226 builtinEntry ,
227227 "Array" ,
228228 NewArray ,
229- ArrayOverloads ( ) ,
230229 null ,
231230 arrayPrototype = new BuiltinObjectValue ( builtinEntry ) {
232231 SpecializedFunction (
@@ -465,7 +464,7 @@ private BuiltinFunctionValue BooleanFunction(out AnalysisValue booleanPrototype)
465464 BuiltinFunction ( "valueOf" ) ,
466465 } ;
467466 booleanPrototype = prototype ;
468- return new BuiltinFunctionValue ( builtinEntry , "Boolean" , BooleanOverloads ( ) , null , prototype ) ;
467+ return new BuiltinFunctionValue ( builtinEntry , "Boolean" , null , prototype ) ;
469468 }
470469
471470 private BuiltinFunctionValue DateFunction ( ) {
@@ -773,7 +772,6 @@ private BuiltinFunctionValue ErrorFunction() {
773772 return new BuiltinFunctionValue (
774773 builtinEntry ,
775774 "Error" ,
776- ErrorOverloads ( ) ,
777775 null ,
778776 new BuiltinObjectValue ( builtinEntry ) {
779777 BuiltinFunction ( "constructor" ) ,
@@ -790,10 +788,9 @@ private BuiltinFunctionValue ErrorFunction(string errorName) {
790788 var builtinEntry = _analyzer . _builtinEntry ;
791789
792790 return new BuiltinFunctionValue (
793- builtinEntry ,
794- errorName ,
795- ErrorOverloads ( errorName ) ,
796- null ,
791+ builtinEntry ,
792+ errorName ,
793+ null ,
797794 new BuiltinObjectValue ( builtinEntry ) {
798795 BuiltinFunction ( "arguments" ) ,
799796 BuiltinFunction ( "constructor" ) ,
@@ -832,7 +829,7 @@ private BuiltinFunctionValue FunctionFunction(out AnalysisValue functionPrototyp
832829 ReturningFunction ( "toString" , _analyzer . _emptyStringValue ) ,
833830 } ;
834831 functionPrototype = prototype ;
835- return new BuiltinFunctionValue ( builtinEntry , "Function" , FunctionOverloads ( ) , null , prototype ) ;
832+ return new BuiltinFunctionValue ( builtinEntry , "Function" , null , prototype ) ;
836833 }
837834
838835 private static IAnalysisSet ApplyFunction ( FunctionValue func , Node node , AnalysisUnit unit , IAnalysisSet @this , IAnalysisSet [ ] args ) {
@@ -1034,7 +1031,7 @@ private BuiltinFunctionValue NumberFunction(out AnalysisValue numberPrototype) {
10341031 } ;
10351032 numberPrototype = prototype ;
10361033
1037- return new BuiltinFunctionValue ( builtinEntry , "Number" , NumberOverloads ( ) , null , prototype ) {
1034+ return new BuiltinFunctionValue ( builtinEntry , "Number" , null , prototype ) {
10381035 Member ( "length" , _analyzer . GetConstant ( 1.0 ) ) ,
10391036 Member ( "name" , _analyzer . GetConstant ( "Number" ) ) ,
10401037 Member ( "arguments" , _analyzer . _nullInst ) ,
@@ -1116,9 +1113,8 @@ private BuiltinFunctionValue ObjectFunction(out ObjectValue objectPrototype, out
11161113
11171114 return new SpecializedFunctionValue (
11181115 builtinEntry ,
1119- "Object" ,
1116+ "Object" ,
11201117 NewObject ,
1121- ObjectOverloads ( ) ,
11221118 null ,
11231119 objectPrototype ) {
11241120 BuiltinFunction (
@@ -1408,7 +1404,6 @@ private BuiltinFunctionValue RegExpFunction() {
14081404 return new BuiltinFunctionValue (
14091405 builtinEntry ,
14101406 "RegExp" ,
1411- RegExpOverloads ( ) ,
14121407 null ,
14131408 new BuiltinObjectValue ( builtinEntry ) {
14141409 BuiltinFunction ( "compile" ) ,
@@ -1646,7 +1641,7 @@ private BuiltinFunctionValue StringFunction(out AnalysisValue stringPrototype) {
16461641 } ;
16471642 stringPrototype = prototype ;
16481643
1649- return new BuiltinFunctionValue ( builtinEntry , "String" , StringOverloads ( ) , null , prototype ) {
1644+ return new BuiltinFunctionValue ( builtinEntry , "String" , null , prototype ) {
16501645 ReturningFunction ( "fromCharCode" , _analyzer . GetConstant ( String . Empty ) ) ,
16511646 } ;
16521647 }
@@ -1681,94 +1676,10 @@ private static IAnalysisSet StringToLowerCase(FunctionValue func, Node node, Ana
16811676 return unit . Analyzer . _emptyStringValue . SelfSet ;
16821677 }
16831678 return res ;
1684- }
1685-
1686- #region Constructor Overloads
1687-
1688- private OverloadResult [ ] ArrayOverloads ( ) {
1689- return new OverloadResult [ ] {
1690- new SimpleOverloadResult ( "Array" , "Create a new and empty array." ) ,
1691- new SimpleOverloadResult ( "Array" , "Create a new array with specific length." ,
1692- Parameter ( "length" , "Length of the new array. Must be between 0 and 2^32-1, inclusive." ) ) ,
1693- new SimpleOverloadResult ( "Array" , "Create a new array with initial elements." ,
1694- Parameter ( "item1" , "Initial element of the array." ) ,
1695- Parameter ( "item2" , "Initial element of the array." ) ,
1696- Parameter ( "[...]" , "Initial element of the array." ) )
1697- } ;
1698- }
1699-
1700- private OverloadResult [ ] StringOverloads ( ) {
1701- return new OverloadResult [ ] {
1702- new SimpleOverloadResult (
1703- "String" ,
1704- "Create a new string." ,
1705- Parameter ( "thing" , "Anything to be converted to a string. If unspecified, an empty string is returned." , isOptional : true )
1706- )
1707- } ;
1708- }
1709-
1710- private OverloadResult [ ] NumberOverloads ( ) {
1711- return new OverloadResult [ ] {
1712- new SimpleOverloadResult (
1713- "Number" ,
1714- "Create a new object wrapper for a numerical value." ,
1715- Parameter ( "value" , "The numeric value of the number being created. If unspecified, 0 is returned." , isOptional : true )
1716- )
1717- } ;
1718- }
1719-
1720- private OverloadResult [ ] BooleanOverloads ( ) {
1721- return new OverloadResult [ ] {
1722- new SimpleOverloadResult (
1723- "Boolean" ,
1724- "Create a new object wrapper for a boolean value." ,
1725- Parameter ( "value" , "The initial value of the Boolean object. In unspecified, <false> is returned." , isOptional : true )
1726- )
1727- } ;
1728- }
1729-
1730- private OverloadResult [ ] ErrorOverloads ( string errorName = "Error" ) {
1731- return new OverloadResult [ ] {
1732- new SimpleOverloadResult (
1733- errorName ,
1734- String . Format ( "Create an {0} object." , errorName ) ,
1735- Parameter ( "message" , "Human-readable description of the error." , isOptional : true )
1736- )
1737- } ;
1738- }
1739-
1740- private OverloadResult [ ] ObjectOverloads ( ) {
1741- return new OverloadResult [ ] {
1742- new SimpleOverloadResult (
1743- "Object" ,
1744- "Create an object wrapper that corresponds to a given value." ,
1745- Parameter ( "value" , "Any value. If the value is unspecified, null or undefined, returns an empty object." , isOptional : true ) )
1746- } ;
1747- }
1748-
1749- private OverloadResult [ ] RegExpOverloads ( ) {
1750- return new OverloadResult [ ] {
1751- new SimpleOverloadResult ( "RegExp" , "Create a regular expression for matching text with a pattern." ,
1752- Parameter ( "pattern" , "The text of the regular expression" ) ,
1753- Parameter ( "flags" , "A combination of g (global match), i (ignore case) and m (multiline)." , isOptional : true ) )
1754- } ;
1755- }
1756-
1757- private OverloadResult [ ] FunctionOverloads ( ) {
1758- return new OverloadResult [ ] {
1759- new SimpleOverloadResult ( "Function" , "Create a new and empty function." ) ,
1760- new SimpleOverloadResult ( "Function" , "Create a new function." ,
1761- Parameter ( "body" , "A string containing the JavaScript statements comprising the function definition." ) ) ,
1762- new SimpleOverloadResult ( "Function" , "Create a new function with arguments." ,
1763- Parameter ( "arg..." , "Name of argument of the function." , isOptional : true ) ,
1764- Parameter ( "body" , "A string containing the JavaScript statements comprising the function definition." ) )
1765- } ;
1766- }
1767-
1768- #endregion
1769-
1679+ }
1680+
17701681 #region Building Helpers
1771-
1682+
17721683 private static MemberAddInfo Member ( string name , AnalysisValue value ) {
17731684 return new MemberAddInfo ( name , value ) ;
17741685 }
0 commit comments