<p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Delagen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Delagen">@Delagen</a> on June 16, 2016 8:9</em></p>
<p dir="auto">simple url <a href="http://site.com/#/route;back=/a/b/c" rel="nofollow">http://site.com/#/route;back=/a/b/c</a></p>
<p dir="auto">Error: Cannot match any routes: 'route;back=true/a/b/c'</p>
<p dir="auto"><em>Copied from original issue: angular/vladivostok#59</em></p>
<p dir="auto">E.g. to make compiler benchmarks more realistic.</p>
<ol dir="auto">
<li>Add general reflector in <code class="notranslate">facade/reflector</code></li>
<li>delete <code class="notranslate">di/reflector</code>, <code class="notranslate">change_detection/parser/closure_map</code>, <code class="notranslate">core/compiler/reflector</code>
<ul dir="auto">
<li>will probably need to add some utility functions in DI that were present in the di/reflector,<br>
but those utilities should be written in AtScript and not JS/Dart specific implementations.</li>
</ul>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class Reflector {
  Function getter(String name) { ... }  
  Function setter(String name) { ... }
  Function method(String name) { ... }
  Function factory(Type type) { ... }
  // one list for every parameter
  // first entry is the parameter type, the rest are the annotations for that parameter
  List&lt;List&lt;Object&gt;&gt; parameters(typeOrFunction) { ... }
  // annotations placed on the type or function
  List&lt;Object&gt; annotations(typeOrFunction) { ... }
}"><pre class="notranslate"><code class="notranslate">class Reflector {
  Function getter(String name) { ... }  
  Function setter(String name) { ... }
  Function method(String name) { ... }
  Function factory(Type type) { ... }
  // one list for every parameter
  // first entry is the parameter type, the rest are the annotations for that parameter
  List&lt;List&lt;Object&gt;&gt; parameters(typeOrFunction) { ... }
  // annotations placed on the type or function
  List&lt;Object&gt; annotations(typeOrFunction) { ... }
}
</code></pre></div>
<p dir="auto">This should be a singleton that is NOT injected via DI:</p>
<ul dir="auto">
<li>the js version should already include caching</li>
<li>the dart production version needs to replace the whole file and not just provide a different<br>
implementation as otherwise Mirrors would still be used by just loading the original file.</li>
<li>the <code class="notranslate">bind</code> helper method in DI relies on a singleton and would otherwise be hard to use</li>
</ul>
<p dir="auto">Example for Dart production version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="getters = {
  &quot;name&quot; : (obj) =&gt; obj.name
  &quot;age&quot; : (obj) =&gt; obj.age
}

methods = {
  &quot;methodName&quot;: (obj, args) =&gt; FuncionWrapper.apply(obj.methodName, args)  
}

factories = {
  Service : (a,b) =&gt; new Service(a,b)
}

parameters = {
  Service: [[]],
  myFactory: [[]]
}

annotations = {
  Service: [[]],
  myFactory: [[]]
}"><pre class="notranslate"><code class="notranslate">getters = {
  "name" : (obj) =&gt; obj.name
  "age" : (obj) =&gt; obj.age
}

methods = {
  "methodName": (obj, args) =&gt; FuncionWrapper.apply(obj.methodName, args)  
}

factories = {
  Service : (a,b) =&gt; new Service(a,b)
}

parameters = {
  Service: [[]],
  myFactory: [[]]
}

annotations = {
  Service: [[]],
  myFactory: [[]]
}
</code></pre></div>