@@ -203,46 +203,36 @@ class ElementBinder {
203
203
204
204
void _link (nodeInjector, probe, scope, nodeAttrs, formatters) {
205
205
_usableDirectiveRefs.forEach ((DirectiveRef ref) {
206
- var linkTimer;
207
- try {
208
- var linkMapTimer;
209
- assert ((linkTimer = _perf.startTimer ('ng.view.link' , ref.type)) != false );
210
- var directive = nodeInjector.get (ref.type);
211
- probe.directives.add (directive);
212
- assert ((linkMapTimer = _perf.startTimer ('ng.view.link.map' , ref.type)) != false );
213
-
214
- if (ref.annotation is Controller ) {
215
- scope.context[(ref.annotation as Controller ).publishAs] = directive;
216
- }
206
+ var directive = nodeInjector.get (ref.type);
207
+ probe.directives.add (directive);
217
208
218
- var tasks = new _TaskList (directive is AttachAware ? ( ) {
219
- if ( scope.isAttached) directive. attach () ;
220
- } : null );
209
+ if (ref.annotation is Controller ) {
210
+ scope.context[(ref.annotation as Controller ).publishAs] = directive;
211
+ }
221
212
222
- if (ref.mappings.isNotEmpty) {
223
- if (nodeAttrs == null ) nodeAttrs = new _AnchorAttrs (ref);
224
- _createAttrMappings (directive, scope, ref.mappings, nodeAttrs, formatters, tasks);
225
- }
213
+ var tasks = new _TaskList (directive is AttachAware ? () {
214
+ if (scope.isAttached) directive.attach ();
215
+ } : null );
226
216
227
- if (directive is AttachAware ) {
228
- var taskId = tasks.registerTask ();
229
- Watch watch;
230
- watch = scope.watch ('1' , // Cheat a bit.
231
- (_, __) {
232
- watch.remove ();
233
- tasks.completeTask (taskId);
234
- });
235
- }
217
+ if (ref.mappings.isNotEmpty) {
218
+ if (nodeAttrs == null ) nodeAttrs = new _AnchorAttrs (ref);
219
+ _createAttrMappings (directive, scope, ref.mappings, nodeAttrs, formatters, tasks);
220
+ }
236
221
237
- tasks.doneRegistering ();
222
+ if (directive is AttachAware ) {
223
+ var taskId = tasks.registerTask ();
224
+ Watch watch;
225
+ watch = scope.watch ('1' , // Cheat a bit.
226
+ (_, __) {
227
+ watch.remove ();
228
+ tasks.completeTask (taskId);
229
+ });
230
+ }
238
231
239
- if (directive is DetachAware ) {
240
- scope.on (ScopeEvent .DESTROY ).listen ((_) => directive.detach ());
241
- }
232
+ tasks.doneRegistering ();
242
233
243
- assert (_perf.stopTimer (linkMapTimer) != false );
244
- } finally {
245
- assert (_perf.stopTimer (linkTimer) != false );
234
+ if (directive is DetachAware ) {
235
+ scope.on (ScopeEvent .DESTROY ).listen ((_) => directive.detach ());
246
236
}
247
237
});
248
238
}
0 commit comments