Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Unified Diff: lib/src/js_ast/printer.dart

Issue 2201973002: fix optional params to mock methods, allow all signatures (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix getters and setters Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/js_ast/printer.dart
diff --git a/lib/src/js_ast/printer.dart b/lib/src/js_ast/printer.dart
index 29bd7797c0335356a5e2fab89a39b3b627d5acb0..9e764aff0cce15da1274e40393f1676848cda647 100644
--- a/lib/src/js_ast/printer.dart
+++ b/lib/src/js_ast/printer.dart
@@ -945,7 +945,8 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor {
visitArrowFun(ArrowFun fun) {
localNamer.enterScope(fun);
if (fun.params.length == 1 &&
- (fun.params.single.type == null || !options.emitTypes)) {
+ fun.params[0] is Identifier &&
+ (!options.emitTypes || fun.params[0].type == null)) {
visitNestedExpression(fun.params.single, SPREAD,
newInForInit: false, newAtStatementBegin: false);
} else {

Powered by Google App Engine
This is Rietveld 408576698