Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
index 846ce8bd2593455d3a28ca66acc18e67cd011c5e..1b7beca01128d80d4827b02b3bfdcfc47b111e52 100644 |
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
@@ -833,6 +833,9 @@ class FragmentEmitter { |
// TODO(herhut): Replace [js.LiteralNull] with [js.ArrayHole]. |
if (method.optionalParameterDefaultValues is List) { |
List<ConstantValue> defaultValues = method.optionalParameterDefaultValues; |
+ if (defaultValues.isEmpty) { |
+ return new js.LiteralNull(); |
+ } |
Iterable<js.Expression> elements = |
defaultValues.map(generateConstantReference); |
return js.js('function() { return #; }', |