From a4e624b34bb4686627bc7873f3e650dbbf23b4c9 Mon Sep 17 00:00:00 2001 From: Ed Rivas Date: Tue, 21 Nov 2023 19:12:57 +0000 Subject: [PATCH] Simplify implementation --- lib/src/js/compiler.dart | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/src/js/compiler.dart b/lib/src/js/compiler.dart index b865a3c3b..5639a5e19 100644 --- a/lib/src/js/compiler.dart +++ b/lib/src/js/compiler.dart @@ -1,5 +1,3 @@ -import 'dart:js_util'; - import 'package:node_interop/js.dart'; import 'compile.dart'; @@ -17,9 +15,7 @@ class Compiler { } } -class AsyncCompiler extends Compiler { - final List _compilations = []; -} +class AsyncCompiler extends Compiler {} /// The JS API Compiler class /// @@ -64,20 +60,15 @@ final JSClass asyncCompilerClass = () { 'compileAsync': (AsyncCompiler self, String path, [CompileOptions? options]) { self.throwIfDisposed(); - var compilation = compileAsync(path, options); - self._compilations.add(compilation); - return compilation; + return compileAsync(path, options); }, 'compileStringAsync': (AsyncCompiler self, String source, [CompileStringOptions? options]) { self.throwIfDisposed(); - var compilation = compileStringAsync(source, options); - self._compilations.add(compilation); - return compilation; + return compileStringAsync(source, options); }, 'dispose': (AsyncCompiler self) async { self._disposed = true; - await Future.wait(self._compilations.map(promiseToFuture)); }, });