@@ -64,31 +64,9 @@ public override void Process()
64
64
65
65
var moduleName = module . LibraryName ;
66
66
67
- // Generate JS module function list.
68
- WriteLine ( $ "static const JSCFunctionListEntry js_{ moduleName } _funcs[] =") ;
69
- WriteOpenBraceAndIndent ( ) ;
70
-
71
- // Foreach translation unit, write the generated functions.
72
- foreach ( var unit in TranslationUnits )
73
- {
74
- var functionPrinter = new QuickJSModuleFunctionPrinter ( Context ) ;
75
- functionPrinter . Indent ( CurrentIndentation ) ;
76
- unit . Visit ( functionPrinter ) ;
77
-
78
- Write ( functionPrinter . Generate ( ) ) ;
79
- }
80
-
81
- Unindent ( ) ;
82
- WriteLine ( "};" ) ;
83
- NewLine ( ) ;
84
-
85
67
// Generate init function.
86
68
WriteLine ( $ "static int js_{ moduleName } _init(JSContext* ctx, JSModuleDef* m)") ;
87
69
WriteOpenBraceAndIndent ( ) ;
88
- /*
89
- WriteLine($"return JS_SetModuleExportList(ctx, m, js_{moduleName}_funcs," +
90
- $" countof(js_{moduleName}_funcs));");
91
- */
92
70
93
71
foreach ( var unit in TranslationUnits )
94
72
{
@@ -125,10 +103,6 @@ public override void Process()
125
103
WriteLine ( $ "register_{ name } (ctx, m, /*set=*/false);") ;
126
104
}
127
105
NewLine ( ) ;
128
- /*
129
- WriteLine($"JS_AddModuleExportList(ctx, m, js_{moduleName}_funcs," +
130
- $" countof(js_{moduleName}_funcs));");
131
- */
132
106
133
107
WriteLine ( "return m;" ) ;
134
108
@@ -152,32 +126,4 @@ public static string GetIncludeFileName(BindingContext context,
152
126
return $ "{ file } .h";
153
127
}
154
128
}
155
-
156
- public class QuickJSModuleFunctionPrinter : CCodeGenerator
157
- {
158
- public QuickJSModuleFunctionPrinter ( BindingContext context )
159
- : base ( context , null )
160
- {
161
- }
162
-
163
- public override bool VisitTranslationUnit ( TranslationUnit unit )
164
- {
165
- WriteLine ( $ "// { QuickJSModule . GetIncludeFileName ( Context , unit ) } ") ;
166
-
167
- return base . VisitTranslationUnit ( unit ) ;
168
- }
169
-
170
- public override bool VisitFunctionDecl ( Function function )
171
- {
172
- if ( ! function . IsGenerated )
173
- return true ;
174
-
175
- /*
176
- WriteLine($"JS_CFUNC_DEF(\"{function.Name}\"," +
177
- $" {function.Parameters.Count}, js_{function.Name}),");
178
- */
179
-
180
- return true ;
181
- }
182
- }
183
129
}
0 commit comments