<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* Fix `of-type` selectors when no context is given by removing the `indexesByTag` cache. [Diego Perini]
+
 * Make `RE_BUGGY_QSAPI` filter out selectors that cause IE to throw errors. [jddalton]
 
 * Fix a bug in the compiler for a selector like `.a1 ~ *` throwing an error when the W3C element traversal api is supported. [jddalton]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -580,23 +580,16 @@ NW.Dom = (function(global) {
   // @return number
   getChildIndexesByTag =
     function(element, name) {
-      var indexes, node, i = 0,
-        id = element[CSS_INDEX] || (element[CSS_INDEX] = ++CSS_ID);
-
-      if (!(indexes = childIndexesByTag[id])) {
-        indexes =
-        indexesByTag = { };
-
-        if ((node = element.firstChild)) {
-          name = name.toUpperCase();
-          do {
-            if (node.nodeName.toUpperCase() == name) {
-              indexes[node[CSS_INDEX] || (node[CSS_INDEX] = ++CSS_ID)] = ++i;
-            }
-          } while ((node = node.nextSibling));
-        }
-        indexes.length = i;
+      var i = 0, indexes = { }, node = element.firstChild;
+      if (node) {
+        name = name.toUpperCase();
+        do {
+          if (node.nodeName.toUpperCase() == name) {
+            indexes[node[CSS_INDEX] || (node[CSS_INDEX] = ++CSS_ID)] = ++i;
+          }
+        } while ((node = node.nextSibling));
       }
+      indexes.length = i;
       return indexes;
     },
 
@@ -1307,7 +1300,6 @@ NW.Dom = (function(global) {
 
       // re-initialize indexes
       childIndexes = { };
-      childIndexesByTag = { };
 
 
       /* pre-filtering pass allow to scale proportionally with big DOM trees */
@@ -1454,8 +1446,6 @@ NW.Dom = (function(global) {
   // ordinal position by nodeType or nodeName
   childIndexes = { },
 
-  childIndexesByTag = { },
-
   // compiled select functions returning collections
   compiledSelectors = { },
 </diff>
      <filename>src/nwmatcher.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>755b241a64197c7f7ce8ff6ec09bbd8d22397ba0</id>
    </parent>
  </parents>
  <author>
    <name>jdalton</name>
    <email>john.david.dalton@gmail.com</email>
  </author>
  <url>http://github.com/jdalton/nwmatcher/commit/d6f5c0998f66e23ee7c06b9c606aba51706700fd</url>
  <id>d6f5c0998f66e23ee7c06b9c606aba51706700fd</id>
  <committed-date>2009-11-10T20:18:06-08:00</committed-date>
  <authored-date>2009-11-10T20:09:24-08:00</authored-date>
  <message>nwmatcher: Fix `of-type` selectors when no context is given by removing the `indexesByTag` cache. [Diego Perini]</message>
  <tree>2de0ad69fd2fdae1a4efde14f193820caed0e701</tree>
  <committer>
    <name>jdalton</name>
    <email>john.david.dalton@gmail.com</email>
  </committer>
</commit>
