@@ -1137,7 +1137,7 @@ public Expression<Func<JSCallbackDescriptor>> BuildConstructorOverloadDescriptor
11371137 * new Type[] { ... }, // Constructor overload parameter types
11381138 * (args) => { ... }); // Constructor overload lambda
11391139 * ... // Additional overloads
1140- * return JSCallbackOverload.CreateDescriptor(overloads);
1140+ * return JSCallbackOverload.CreateDescriptor(typeName, overloads);
11411141 */
11421142
11431143 ParameterExpression overloadsVariable =
@@ -1166,9 +1166,12 @@ public Expression<Func<JSCallbackDescriptor>> BuildConstructorOverloadDescriptor
11661166 }
11671167
11681168 MethodInfo createDescriptorMethod = typeof ( JSCallbackOverload ) . GetStaticMethod (
1169- nameof ( JSCallbackOverload . CreateDescriptor ) ) ;
1169+ nameof ( JSCallbackOverload . CreateDescriptor ) ,
1170+ new Type [ ] { typeof ( string ) , typeof ( JSCallbackOverload [ ] ) } ) ;
11701171 statements [ statements . Length - 1 ] = Expression . Call (
1171- createDescriptorMethod , overloadsVariable ) ;
1172+ createDescriptorMethod ,
1173+ Expression . Constant ( constructors [ 0 ] . DeclaringType ! . Name ) ,
1174+ overloadsVariable ) ;
11721175
11731176 return ( Expression < Func < JSCallbackDescriptor > > ) Expression . Lambda (
11741177 typeof ( Func < JSCallbackDescriptor > ) ,
@@ -1181,10 +1184,9 @@ public Expression<Func<JSCallbackDescriptor>> BuildConstructorOverloadDescriptor
11811184 }
11821185
11831186 /// <summary>
1184- /// Builds a callback descriptor that resolves and invokes the best-matching overload from
1185- /// a set of overloaded constructors.
1187+ /// Gets overload information for a set of constructors.
11861188 /// </summary>
1187- public JSCallbackDescriptor BuildConstructorOverloadDescriptor ( ConstructorInfo [ ] constructors )
1189+ public JSCallbackOverload [ ] GetConstructorOverloads ( ConstructorInfo [ ] constructors )
11881190 {
11891191 JSCallbackOverload [ ] overloads = new JSCallbackOverload [ constructors . Length ] ;
11901192 for ( int i = 0 ; i < constructors . Length ; i ++ )
@@ -1203,7 +1205,7 @@ public JSCallbackDescriptor BuildConstructorOverloadDescriptor(ConstructorInfo[]
12031205 BuildFromJSConstructorExpression ( constructors [ i ] ) . Compile ( ) ;
12041206 overloads [ i ] = new JSCallbackOverload ( parameterTypes , constructorDelegate ) ;
12051207 }
1206- return JSCallbackOverload . CreateDescriptor ( overloads ) ;
1208+ return overloads ;
12071209 }
12081210
12091211 /// <summary>
@@ -1225,7 +1227,7 @@ public Expression<Func<JSCallbackDescriptor>> BuildMethodOverloadDescriptorExpre
12251227 * new Type[] { ... }, // Method overload parameter types
12261228 * (args) => { ... }); // Method overload lambda
12271229 * ... // Additional overloads
1228- * return JSCallbackOverload.CreateDescriptor(overloads);
1230+ * return JSCallbackOverload.CreateDescriptor(methodName, overloads);
12291231 */
12301232
12311233 ParameterExpression overloadsVariable =
@@ -1254,9 +1256,12 @@ public Expression<Func<JSCallbackDescriptor>> BuildMethodOverloadDescriptorExpre
12541256 }
12551257
12561258 MethodInfo createDescriptorMethod = typeof ( JSCallbackOverload ) . GetStaticMethod (
1257- nameof ( JSCallbackOverload . CreateDescriptor ) ) ;
1259+ nameof ( JSCallbackOverload . CreateDescriptor ) ,
1260+ new Type [ ] { typeof ( string ) , typeof ( JSCallbackOverload [ ] ) } ) ;
12581261 statements [ statements . Length - 1 ] = Expression . Call (
1259- createDescriptorMethod , overloadsVariable ) ;
1262+ createDescriptorMethod ,
1263+ Expression . Constant ( methods [ 0 ] . Name ) ,
1264+ overloadsVariable ) ;
12601265
12611266 return ( Expression < Func < JSCallbackDescriptor > > ) Expression . Lambda (
12621267 typeof ( Func < JSCallbackDescriptor > ) ,
@@ -1269,10 +1274,9 @@ public Expression<Func<JSCallbackDescriptor>> BuildMethodOverloadDescriptorExpre
12691274 }
12701275
12711276 /// <summary>
1272- /// Builds a callback descriptor that resolves and invokes the best-matching overload from
1273- /// a set of overloaded methods.
1277+ /// Gets overload information for a set of overloaded methods.
12741278 /// </summary>
1275- public JSCallbackDescriptor BuildMethodOverloadDescriptor ( MethodInfo [ ] methods )
1279+ public JSCallbackOverload [ ] GetMethodOverloads ( MethodInfo [ ] methods )
12761280 {
12771281 JSCallbackOverload [ ] overloads = new JSCallbackOverload [ methods . Length ] ;
12781282 for ( int i = 0 ; i < methods . Length ; i ++ )
@@ -1292,7 +1296,7 @@ public JSCallbackDescriptor BuildMethodOverloadDescriptor(MethodInfo[] methods)
12921296 BuildFromJSMethodExpression ( methods [ i ] ) . Compile ( ) ;
12931297 overloads [ i ] = new JSCallbackOverload ( parameterTypes , defaultValues , methodDelegate ) ;
12941298 }
1295- return JSCallbackOverload . CreateDescriptor ( overloads ) ;
1299+ return overloads ;
12961300 }
12971301
12981302 private Expression < JSCallback > BuildFromJSStaticMethodExpression ( MethodInfo method )
0 commit comments