| Index: lib/src/js/template.dart
|
| diff --git a/lib/src/js/template.dart b/lib/src/js/template.dart
|
| index b19ae4720206117e606e077c14b81080537b828e..9551b7f4694670ca19c30989502ca25e815e9f68 100644
|
| --- a/lib/src/js/template.dart
|
| +++ b/lib/src/js/template.dart
|
| @@ -118,6 +118,15 @@ class Template {
|
| }
|
| return instantiator(arguments);
|
| }
|
| +
|
| + /// Like [instantiate] but works with free variables.
|
| + Node safeCreate(Map arguments) {
|
| + if (holeNames.isEmpty) return ast;
|
| + return instantiator(new Map.fromIterable(holeNames, value: (name) {
|
| + var a = arguments[name];
|
| + return a != null ? a : new InterpolatedExpression(name);
|
| + }));
|
| + }
|
| }
|
|
|
| /**
|
|
|