@@ -10,9 +10,7 @@ import 'dart:typed_data';
1010import 'package:js/js.dart' ;
1111import 'package:node_interop/js.dart' ;
1212import 'package:path/path.dart' as p;
13- import 'package:tuple/tuple.dart' ;
1413
15- import '../ast/sass.dart' ;
1614import '../callable.dart' ;
1715import '../compile.dart' ;
1816import '../compile_result.dart' ;
@@ -21,7 +19,6 @@ import '../importer/legacy_node.dart';
2119import '../io.dart' ;
2220import '../logger.dart' ;
2321import '../logger/node_to_dart.dart' ;
24- import '../parse/scss.dart' ;
2522import '../syntax.dart' ;
2623import '../util/nullable.dart' ;
2724import '../utils.dart' ;
@@ -208,22 +205,12 @@ List<AsyncCallable> _parseFunctions(RenderOptions options, DateTime start,
208205
209206 var result = < AsyncCallable > [];
210207 jsForEach (functions, (signature, callback) {
211- Tuple2 <String , ArgumentDeclaration > tuple;
212- try {
213- tuple = ScssParser (signature).parseSignature (requireParens: false );
214- } on SassFormatException catch (error, stackTrace) {
215- throwWithTrace (
216- SassFormatException (
217- 'Invalid signature "$signature ": ${error .message }' , error.span),
218- stackTrace);
219- }
220-
221208 var context = RenderContext (options: _contextOptions (options, start));
222209 context.options.context = context;
223210
224211 var fiber = options.fiber;
225212 if (fiber != null ) {
226- result.add (BuiltInCallable . parsed (tuple.item1, tuple.item2 , (arguments) {
213+ result.add (Callable . fromSignature (signature , (arguments) {
227214 var currentFiber = fiber.current;
228215 var jsArguments = [
229216 ...arguments.map (wrapValue),
@@ -240,16 +227,15 @@ List<AsyncCallable> _parseFunctions(RenderOptions options, DateTime start,
240227 // `Zone.current` in an inconsistent state.
241228 ? runZoned (() => fiber.yield ())
242229 : result);
243- }));
230+ }, requireParens : false ));
244231 } else if (! asynch) {
245- result.add (BuiltInCallable .parsed (
246- tuple.item1,
247- tuple.item2,
232+ result.add (Callable .fromSignature (
233+ signature,
248234 (arguments) => unwrapValue ((callback as JSFunction )
249- .apply (context, arguments.map (wrapValue).toList ()))));
235+ .apply (context, arguments.map (wrapValue).toList ())),
236+ requireParens: false ));
250237 } else {
251- result.add (AsyncBuiltInCallable .parsed (tuple.item1, tuple.item2,
252- (arguments) async {
238+ result.add (AsyncCallable .fromSignature (signature, (arguments) async {
253239 var completer = Completer <Object ?>();
254240 var jsArguments = [
255241 ...arguments.map (wrapValue),
@@ -258,7 +244,7 @@ List<AsyncCallable> _parseFunctions(RenderOptions options, DateTime start,
258244 var result = (callback as JSFunction ).apply (context, jsArguments);
259245 return unwrapValue (
260246 isUndefined (result) ? await completer.future : result);
261- }));
247+ }, requireParens : false ));
262248 }
263249 });
264250 return result;
0 commit comments