Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

Commit

Permalink
perf(injector): skip _checkKeyConditions in dart2js
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj committed Apr 14, 2014
1 parent 347a6fb commit 6763552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/injector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Injector {
}

dynamic _getInstanceByKey(Key key, Injector requester) {
_checkKeyConditions(key);
assert(_checkKeyConditions(key));

if (resolving.contains(key)) {
throw new CircularDependencyError(
Expand Down Expand Up @@ -154,11 +154,12 @@ class Injector {
throw new NoProviderError(_error('No provider found for ${key}!', key));
}

void _checkKeyConditions(Key key) {
bool _checkKeyConditions(Key key) {
if (_PRIMITIVE_TYPES.contains(key)) {
throw new NoProviderError(_error('Cannot inject a primitive type '
'of ${key.type}!', key));
}
return true;
}


Expand Down

0 comments on commit 6763552

Please sign in to comment.