blob: c6db67e3847a13d681924dfbfc8128ce73257140 [file] [log] [blame]
<html><head><style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='linenumber'> 1</span> <span class="COMM">// Copyright 2009 Google Inc. All Rights Reserved.</span><span class="WHIT">
<span class='linenumber'> 2</span> </span><span class="COMM">//</span><span class="WHIT">
<span class='linenumber'> 3</span> </span><span class="COMM">// Licensed under the Apache License, Version 2.0 (the "License");</span><span class="WHIT">
<span class='linenumber'> 4</span> </span><span class="COMM">// you may not use this file except in compliance with the License.</span><span class="WHIT">
<span class='linenumber'> 5</span> </span><span class="COMM">// You may obtain a copy of the License at</span><span class="WHIT">
<span class='linenumber'> 6</span> </span><span class="COMM">//</span><span class="WHIT">
<span class='linenumber'> 7</span> </span><span class="COMM">// http://www.apache.org/licenses/LICENSE-2.0</span><span class="WHIT">
<span class='linenumber'> 8</span> </span><span class="COMM">//</span><span class="WHIT">
<span class='linenumber'> 9</span> </span><span class="COMM">// Unless required by applicable law or agreed to in writing, software</span><span class="WHIT">
<span class='linenumber'> 10</span> </span><span class="COMM">// distributed under the License is distributed on an "AS-IS" BASIS,</span><span class="WHIT">
<span class='linenumber'> 11</span> </span><span class="COMM">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span><span class="WHIT">
<span class='linenumber'> 12</span> </span><span class="COMM">// See the License for the specific language governing permissions and</span><span class="WHIT">
<span class='linenumber'> 13</span> </span><span class="COMM">// limitations under the License.</span><span class="WHIT">
<span class='linenumber'> 14</span>
<span class='linenumber'> 15</span> </span><span class="COMM">/**
<span class='linenumber'> 16</span> * @fileoverview Factory methods for constructing error-suppression filters.
<span class='linenumber'> 17</span> */</span><span class="WHIT">
<span class='linenumber'> 18</span>
<span class='linenumber'> 19</span> </span><span class="COMM">/**
<span class='linenumber'> 20</span> * In this file, filters (whether their static factory methods or their class
<span class='linenumber'> 21</span> * definitions) are ordered alphabetically.
<span class='linenumber'> 22</span> */</span><span class="WHIT">
<span class='linenumber'> 23</span>
<span class='linenumber'> 24</span>
<span class='linenumber'> 25</span> </span><span class="NAME">goog.provide</span><span class="PUNC">(</span><span class="STRN">'bidichecker.FilterFactory'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 26</span> </span><span class="NAME">goog.provide</span><span class="PUNC">(</span><span class="STRN">'bidichecker.FilterFactory.ComposableFilter'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 27</span>
<span class='linenumber'> 28</span> </span><span class="NAME">goog.require</span><span class="PUNC">(</span><span class="STRN">'bidichecker.Filter'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 29</span> </span><span class="NAME">goog.require</span><span class="PUNC">(</span><span class="STRN">'goog.json'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 30</span>
<span class='linenumber'> 31</span>
<span class='linenumber'> 32</span> </span><span class="COMM">/**
<span class='linenumber'> 33</span> * Abstract base class for custom filter classes, providing them with
<span class='linenumber'> 34</span> * <code>and()</code>, <code>or()</code> and <code>not()</code> methods.
<span class='linenumber'> 35</span> * @constructor
<span class='linenumber'> 36</span> * @implements {bidichecker.Filter}
<span class='linenumber'> 37</span> * @export
<span class='linenumber'> 38</span> */</span><span class="WHIT">
<span class='linenumber'> 39</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 40</span>
<span class='linenumber'> 41</span>
<span class='linenumber'> 42</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'> 43</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'> 44</span> </span><span class="NAME">goog.abstractMethod</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 45</span>
<span class='linenumber'> 46</span>
<span class='linenumber'> 47</span> </span><span class="COMM">/**
<span class='linenumber'> 48</span> * Create a filter which ands this filter with another.
<span class='linenumber'> 49</span> * @param {!bidichecker.Filter} other The second subfilter.
<span class='linenumber'> 50</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'> 51</span> * @export
<span class='linenumber'> 52</span> */</span><span class="WHIT">
<span class='linenumber'> 53</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter.prototype.and</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">other</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 54</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.and</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">other</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 55</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 56</span>
<span class='linenumber'> 57</span>
<span class='linenumber'> 58</span> </span><span class="COMM">/**
<span class='linenumber'> 59</span> * Create a filter which inverts this filter.
<span class='linenumber'> 60</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'> 61</span> * @export
<span class='linenumber'> 62</span> */</span><span class="WHIT">
<span class='linenumber'> 63</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter.prototype.not</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 64</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.not</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 65</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 66</span>
<span class='linenumber'> 67</span>
<span class='linenumber'> 68</span> </span><span class="COMM">/**
<span class='linenumber'> 69</span> * Create a filter which ors this filter with another.
<span class='linenumber'> 70</span> * @param {!bidichecker.Filter} other The second subfilter.
<span class='linenumber'> 71</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'> 72</span> * @export
<span class='linenumber'> 73</span> */</span><span class="WHIT">
<span class='linenumber'> 74</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter.prototype.or</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">other</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 75</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.or</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">other</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 76</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 77</span>
<span class='linenumber'> 78</span>
<span class='linenumber'> 79</span> </span><span class="COMM">/**
<span class='linenumber'> 80</span> * Constructs a suppression filter from a bare object with suitable contents.
<span class='linenumber'> 81</span> * For use in deserializing filters from JSON. Throws a string exception if an
<span class='linenumber'> 82</span> * invalid filter is encountered.
<span class='linenumber'> 83</span> * @param {!Object} bareFilter The object representing the filter. Must contain
<span class='linenumber'> 84</span> * an <code>'opcode'</code> field with a string indicating the filter type.
<span class='linenumber'> 85</span> * Other supported field names and types are dependent on the filter type.
<span class='linenumber'> 86</span> * @return {!bidichecker.FilterFactory.ComposableFilter} The new filter.
<span class='linenumber'> 87</span> * @private
<span class='linenumber'> 88</span> */</span><span class="WHIT">
<span class='linenumber'> 89</span> </span><span class="NAME">bidichecker.FilterFactory.constructFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 90</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">opcode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bareFilter</span><span class="PUNC">[</span><span class="STRN">'opcode'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 91</span> </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">opcode</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 92</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'AND'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'> 93</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.AndFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 94</span>
<span class='linenumber'> 95</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'AT_TEXT'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'> 96</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.AtTextFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 97</span>
<span class='linenumber'> 98</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'AT_TEXT_REGEXP'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'> 99</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.AtTextRegexpFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>100</span>
<span class='linenumber'>101</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'FOLLOWED_BY_TEXT'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>102</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>103</span>
<span class='linenumber'>104</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'FOLLOWED_BY_TEXT_REGEXP'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>105</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>106</span> </span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>107</span>
<span class='linenumber'>108</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'LOCATION_CLASS'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>109</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationClassFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>110</span>
<span class='linenumber'>111</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'LOCATION_CLASS_REGEXP'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>112</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationClassRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>113</span> </span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>114</span>
<span class='linenumber'>115</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'LOCATION_ID'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>116</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationIdFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>117</span>
<span class='linenumber'>118</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'LOCATION_ID_REGEXP'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>119</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationIdRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>120</span> </span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>121</span>
<span class='linenumber'>122</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'NOT'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>123</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.NotFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>124</span>
<span class='linenumber'>125</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'OR'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>126</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.OrFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>127</span>
<span class='linenumber'>128</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'PRECEDED_BY_TEXT'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>129</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.PrecededByTextFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>130</span>
<span class='linenumber'>131</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'PRECEDED_BY_TEXT_REGEXP'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>132</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.PrecededByTextRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>133</span> </span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>134</span>
<span class='linenumber'>135</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'SEVERITY'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>136</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.SeverityFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>137</span>
<span class='linenumber'>138</span> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'TYPE'</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>139</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.TypeFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>140</span>
<span class='linenumber'>141</span> </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='linenumber'>142</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Unknown filter opcode: \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">opcode</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\''</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>143</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>144</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>145</span>
<span class='linenumber'>146</span>
<span class='linenumber'>147</span> </span><span class="COMM">/**
<span class='linenumber'>148</span> * Deserializes a list of suppression filters from a JSON-format string.
<span class='linenumber'>149</span> * Throws a string exception if an unknown filter is encountered.
<span class='linenumber'>150</span> * @param {string=} opt_filtersJson The input string, if provided.
<span class='linenumber'>151</span> * @return {Array.&lt;!bidichecker.Filter>} The error suppression filters.
<span class='linenumber'>152</span> */</span><span class="WHIT">
<span class='linenumber'>153</span> </span><span class="NAME">bidichecker.FilterFactory.readFiltersFromJson</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">opt_filtersJson</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>154</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">opt_filtersJson</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>155</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>156</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>157</span>
<span class='linenumber'>158</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bareFilters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>159</span> </span><span class="PUNC">(</span><span class="COMM">/** @type {Array.&lt;!Object>} */</span><span class="WHIT"> </span><span class="NAME">goog.json.parse</span><span class="PUNC">(</span><span class="NAME">opt_filtersJson</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>160</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">goog.array.map</span><span class="PUNC">(</span><span class="NAME">bareFilters</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>161</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.constructFilter_</span><span class="PUNC">(</span><span class="NAME">bareFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>162</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>163</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>164</span>
<span class='linenumber'>165</span>
<span class='linenumber'>166</span> </span><span class="COMM">/**
<span class='linenumber'>167</span> * Create a filter which suppresses errors by and-ing component filters.
<span class='linenumber'>168</span> * @param {!bidichecker.Filter} filter1 The first subfilter.
<span class='linenumber'>169</span> * @param {!bidichecker.Filter} filter2 The second subfilter.
<span class='linenumber'>170</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>171</span> * @export
<span class='linenumber'>172</span> */</span><span class="WHIT">
<span class='linenumber'>173</span> </span><span class="NAME">bidichecker.FilterFactory.and</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filter1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">filter2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>174</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.AndFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>175</span> </span><span class="PUNC">{</span><span class="STRN">'filter1'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filter1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'filter2'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filter2</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>176</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>177</span>
<span class='linenumber'>178</span>
<span class='linenumber'>179</span> </span><span class="COMM">/**
<span class='linenumber'>180</span> * Create a filter which suppresses errors based on a literal match of their
<span class='linenumber'>181</span> * <code>atText</code> fields.
<span class='linenumber'>182</span> * @param {?string} atText A string which must match the entire <code>atText</code>
<span class='linenumber'>183</span> * field. If empty or null, will only match an empty or null <code>atText</code>.
<span class='linenumber'>184</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>185</span> * @export
<span class='linenumber'>186</span> */</span><span class="WHIT">
<span class='linenumber'>187</span> </span><span class="NAME">bidichecker.FilterFactory.atText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">atText</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>188</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.AtTextFilter_</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'atText'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">atText</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>189</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>190</span>
<span class='linenumber'>191</span>
<span class='linenumber'>192</span> </span><span class="COMM">/**
<span class='linenumber'>193</span> * Create a filter which suppresses errors by applying a regular expression to
<span class='linenumber'>194</span> * their <code>atText</code> fields.
<span class='linenumber'>195</span> * @param {string|RegExp} atTextRegexp A regular expression, which must match
<span class='linenumber'>196</span> * the entire <code>atText</code> field. If empty or null, will only match an
<span class='linenumber'>197</span> * empty or null <code>atText</code>.
<span class='linenumber'>198</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>199</span> * @export
<span class='linenumber'>200</span> */</span><span class="WHIT">
<span class='linenumber'>201</span> </span><span class="NAME">bidichecker.FilterFactory.atTextRegexp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">atTextRegexp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>202</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.AtTextRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>203</span> </span><span class="PUNC">{</span><span class="STRN">'atTextRegexp'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">atTextRegexp</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>204</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>205</span>
<span class='linenumber'>206</span>
<span class='linenumber'>207</span> </span><span class="COMM">/**
<span class='linenumber'>208</span> * Create a filter which suppresses errors based on a literal match of their
<span class='linenumber'>209</span> * <code>followedByText</code> fields.
<span class='linenumber'>210</span> * @param {?string} followedByText A string which must match the entire
<span class='linenumber'>211</span> * <code>followedByText</code> field. If empty or null, will only match an empty
<span class='linenumber'>212</span> * or null <code>followedByText</code>.
<span class='linenumber'>213</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>214</span> * @export
<span class='linenumber'>215</span> */</span><span class="WHIT">
<span class='linenumber'>216</span> </span><span class="NAME">bidichecker.FilterFactory.followedByText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">followedByText</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>217</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>218</span> </span><span class="PUNC">{</span><span class="STRN">'followedByText'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">followedByText</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>219</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>220</span>
<span class='linenumber'>221</span>
<span class='linenumber'>222</span> </span><span class="COMM">/**
<span class='linenumber'>223</span> * Create a filter which suppresses errors by applying a regular expression to
<span class='linenumber'>224</span> * their <code>followedByText</code> fields.
<span class='linenumber'>225</span> * @param {string|RegExp} followedByTextRegexp A regular expression, which must
<span class='linenumber'>226</span> * match the entire <code>followedByText</code> field. If empty or null, will
<span class='linenumber'>227</span> * only match an empty or null <code>followedByText</code>.
<span class='linenumber'>228</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>229</span> * @export
<span class='linenumber'>230</span> */</span><span class="WHIT">
<span class='linenumber'>231</span> </span><span class="NAME">bidichecker.FilterFactory.followedByTextRegexp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>232</span> </span><span class="NAME">followedByTextRegexp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>233</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>234</span> </span><span class="PUNC">{</span><span class="STRN">'followedByTextRegexp'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">followedByTextRegexp</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>235</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>236</span>
<span class='linenumber'>237</span>
<span class='linenumber'>238</span> </span><span class="COMM">/**
<span class='linenumber'>239</span> * Create a filter which suppresses errors based on a literal match of one of
<span class='linenumber'>240</span> * the class names of any parent node of the error location in the DOM.
<span class='linenumber'>241</span> * @param {string} className A string which must match one of the class names in
<span class='linenumber'>242</span> * the <code>class</code> attribute of the location or one of its ancestors. Must
<span class='linenumber'>243</span> * not be empty or null.
<span class='linenumber'>244</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>245</span> * @export
<span class='linenumber'>246</span> */</span><span class="WHIT">
<span class='linenumber'>247</span> </span><span class="NAME">bidichecker.FilterFactory.locationClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">className</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>248</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">className</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">className</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>249</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Empty or null argument to bidichecker.FilterFactory.locationClass'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>250</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>251</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationClassFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>252</span> </span><span class="PUNC">{</span><span class="STRN">'className'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>253</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>254</span>
<span class='linenumber'>255</span>
<span class='linenumber'>256</span> </span><span class="COMM">/**
<span class='linenumber'>257</span> * Create a filter which suppresses errors based on a regular expression match
<span class='linenumber'>258</span> * of one of the class names of any parent node of the error location in the
<span class='linenumber'>259</span> * DOM.
<span class='linenumber'>260</span> * @param {string|RegExp} classRegexp A regular expression, which must match
<span class='linenumber'>261</span> * one of the class names in the <code>class</code> attribute of the location or
<span class='linenumber'>262</span> * one of its ancestors. Must not be empty or null.
<span class='linenumber'>263</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>264</span> * @export
<span class='linenumber'>265</span> */</span><span class="WHIT">
<span class='linenumber'>266</span> </span><span class="NAME">bidichecker.FilterFactory.locationClassRegexp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">classRegexp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>267</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">classRegexp</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">classRegexp</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>268</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Empty or null argument to '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>269</span> </span><span class="STRN">'bidichecker.FilterFactory.locationClassRegexp'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>270</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>271</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationClassRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>272</span> </span><span class="PUNC">{</span><span class="STRN">'classRegexp'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">classRegexp</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>273</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>274</span>
<span class='linenumber'>275</span>
<span class='linenumber'>276</span> </span><span class="COMM">/**
<span class='linenumber'>277</span> * Create a filter which suppresses errors based on a literal match of the error
<span class='linenumber'>278</span> * location's (or one of its DOM ancestors') <code>id</code> attribute.
<span class='linenumber'>279</span> * @param {string} id A string which must match the entire <code>id</code> attribute
<span class='linenumber'>280</span> * of the location or one of its ancestors. Must not be empty or null.
<span class='linenumber'>281</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>282</span> * @export
<span class='linenumber'>283</span> */</span><span class="WHIT">
<span class='linenumber'>284</span> </span><span class="NAME">bidichecker.FilterFactory.locationId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>285</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>286</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Empty or null argument to bidichecker.FilterFactory.locationId'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>287</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>288</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationIdFilter_</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'id'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>289</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>290</span>
<span class='linenumber'>291</span>
<span class='linenumber'>292</span> </span><span class="COMM">/**
<span class='linenumber'>293</span> * Create a filter which suppresses errors by applying a regular expression to
<span class='linenumber'>294</span> * the error location's (or one of its DOM ancestors') <code>id</code> attribute.
<span class='linenumber'>295</span> * @param {string|RegExp} idRegexp A regular expression, which must match the
<span class='linenumber'>296</span> * entire <code>id</code> attribute of the location or one of its ancestors. Must
<span class='linenumber'>297</span> * not be empty or null.
<span class='linenumber'>298</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>299</span> * @export
<span class='linenumber'>300</span> */</span><span class="WHIT">
<span class='linenumber'>301</span> </span><span class="NAME">bidichecker.FilterFactory.locationIdRegexp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">idRegexp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>302</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">idRegexp</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">idRegexp</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>303</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Empty or null argument to '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>304</span> </span><span class="STRN">'bidichecker.FilterFactory.locationIdRegexp'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>305</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>306</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.LocationIdRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>307</span> </span><span class="PUNC">{</span><span class="STRN">'idRegexp'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">idRegexp</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>308</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>309</span>
<span class='linenumber'>310</span>
<span class='linenumber'>311</span> </span><span class="COMM">/**
<span class='linenumber'>312</span> * Create a filter which suppresses errors by inverting another filter.
<span class='linenumber'>313</span> * @param {!bidichecker.Filter} filter The subfilter.
<span class='linenumber'>314</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>315</span> * @export
<span class='linenumber'>316</span> */</span><span class="WHIT">
<span class='linenumber'>317</span> </span><span class="NAME">bidichecker.FilterFactory.not</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>318</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.NotFilter_</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'filter'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filter</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>319</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>320</span>
<span class='linenumber'>321</span>
<span class='linenumber'>322</span> </span><span class="COMM">/**
<span class='linenumber'>323</span> * Create a filter which suppresses errors by or-ing component filters.
<span class='linenumber'>324</span> * @param {!bidichecker.Filter} filter1 The first subfilter.
<span class='linenumber'>325</span> * @param {!bidichecker.Filter} filter2 The second subfilter.
<span class='linenumber'>326</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>327</span> * @export
<span class='linenumber'>328</span> */</span><span class="WHIT">
<span class='linenumber'>329</span> </span><span class="NAME">bidichecker.FilterFactory.or</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filter1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">filter2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>330</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.OrFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>331</span> </span><span class="PUNC">{</span><span class="STRN">'filter1'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filter1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'filter2'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filter2</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>332</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>333</span>
<span class='linenumber'>334</span>
<span class='linenumber'>335</span> </span><span class="COMM">/**
<span class='linenumber'>336</span> * Create a filter which suppresses errors based on a literal match of their
<span class='linenumber'>337</span> * <code>precededByText</code> fields.
<span class='linenumber'>338</span> * @param {?string} precededByText A string which must match the entire
<span class='linenumber'>339</span> * <code>precededByText</code> field. If empty or null, will only match an empty
<span class='linenumber'>340</span> * or null <code>precededByText</code>.
<span class='linenumber'>341</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>342</span> * @export
<span class='linenumber'>343</span> */</span><span class="WHIT">
<span class='linenumber'>344</span> </span><span class="NAME">bidichecker.FilterFactory.precededByText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">precededByText</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>345</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.PrecededByTextFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>346</span> </span><span class="PUNC">{</span><span class="STRN">'precededByText'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">precededByText</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>347</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>348</span>
<span class='linenumber'>349</span>
<span class='linenumber'>350</span> </span><span class="COMM">/**
<span class='linenumber'>351</span> * Create a filter which suppresses errors by applying a regular expression to
<span class='linenumber'>352</span> * their <code>precededByText</code> fields.
<span class='linenumber'>353</span> * @param {string|RegExp} precededByTextRegexp A regular expression, which must
<span class='linenumber'>354</span> * match the entire <code>precededByText</code> field. If empty or null, will
<span class='linenumber'>355</span> * only match an empty or null <code>precededByText</code>.
<span class='linenumber'>356</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>357</span> * @export
<span class='linenumber'>358</span> */</span><span class="WHIT">
<span class='linenumber'>359</span> </span><span class="NAME">bidichecker.FilterFactory.precededByTextRegexp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>360</span> </span><span class="NAME">precededByTextRegexp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>361</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.PrecededByTextRegexpFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>362</span> </span><span class="PUNC">{</span><span class="STRN">'precededByTextRegexp'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">precededByTextRegexp</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>363</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>364</span>
<span class='linenumber'>365</span>
<span class='linenumber'>366</span> </span><span class="COMM">/**
<span class='linenumber'>367</span> * Create a filter which suppresses errors based on their severity levels.
<span class='linenumber'>368</span> * @param {number} severityThreshold the severity level from which errors should
<span class='linenumber'>369</span> * be suppressed. At level 1, all messages will be filtered out. Note that
<span class='linenumber'>370</span> * higher values indicate lower severities.
<span class='linenumber'>371</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>372</span> * @export
<span class='linenumber'>373</span> */</span><span class="WHIT">
<span class='linenumber'>374</span> </span><span class="NAME">bidichecker.FilterFactory.severityFrom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">severityThreshold</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>375</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.SeverityFilter_</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>376</span> </span><span class="PUNC">{</span><span class="STRN">'severityThreshold'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">severityThreshold</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>377</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>378</span>
<span class='linenumber'>379</span>
<span class='linenumber'>380</span> </span><span class="COMM">/**
<span class='linenumber'>381</span> * Create a filter which suppresses errors based on their type fields.
<span class='linenumber'>382</span> * @param {string} type The error type name to be matched exactly.
<span class='linenumber'>383</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter object.
<span class='linenumber'>384</span> * @export
<span class='linenumber'>385</span> */</span><span class="WHIT">
<span class='linenumber'>386</span> </span><span class="NAME">bidichecker.FilterFactory.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>387</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.TypeFilter_</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'type'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>388</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>389</span>
<span class='linenumber'>390</span>
<span class='linenumber'>391</span> </span><span class="COMM">/**
<span class='linenumber'>392</span> * Checks that a required field exists in an object representing a filter, or
<span class='linenumber'>393</span> * else throws a string exception.
<span class='linenumber'>394</span> * @param {!Object} bareObject The object representing the filter.
<span class='linenumber'>395</span> * @param {string} field The name of the field.
<span class='linenumber'>396</span> * @private
<span class='linenumber'>397</span> */</span><span class="WHIT">
<span class='linenumber'>398</span> </span><span class="NAME">bidichecker.FilterFactory.checkParamExists_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>399</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">field</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>400</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'No \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' parameter found for \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>401</span> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="STRN">'opcode'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' filter'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>402</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>403</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>404</span>
<span class='linenumber'>405</span>
<span class='linenumber'>406</span> </span><span class="COMM">/**
<span class='linenumber'>407</span> * Checks that a required field of a given type exists in an object representing
<span class='linenumber'>408</span> * a filter, or else throws a string exception.
<span class='linenumber'>409</span> * @param {!Object} bareObject The object representing the filter.
<span class='linenumber'>410</span> * @param {string} field The name of the field.
<span class='linenumber'>411</span> * @param {string} type The required type of the field.
<span class='linenumber'>412</span> * @private
<span class='linenumber'>413</span> */</span><span class="WHIT">
<span class='linenumber'>414</span> </span><span class="NAME">bidichecker.FilterFactory.checkParam_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>415</span> </span><span class="NAME">bidichecker.FilterFactory.checkParamExists_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>416</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="NAME">field</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>417</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Wrong type for \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' parameter of \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>418</span> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="STRN">'opcode'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' filter; expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>419</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>420</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>421</span>
<span class='linenumber'>422</span>
<span class='linenumber'>423</span> </span><span class="COMM">/**
<span class='linenumber'>424</span> * Reads a string-valued field from an object representing a filter.
<span class='linenumber'>425</span> * @param {!Object} bareObject The object representing the filter.
<span class='linenumber'>426</span> * @param {string} field The name of the field.
<span class='linenumber'>427</span> * @return {string} The field value.
<span class='linenumber'>428</span> * @private
<span class='linenumber'>429</span> */</span><span class="WHIT">
<span class='linenumber'>430</span> </span><span class="NAME">bidichecker.FilterFactory.getStringParam_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>431</span> </span><span class="NAME">bidichecker.FilterFactory.checkParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>432</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="COMM">/** @type {string} */</span><span class="WHIT"> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="NAME">field</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>433</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>434</span>
<span class='linenumber'>435</span>
<span class='linenumber'>436</span> </span><span class="COMM">/**
<span class='linenumber'>437</span> * Reads a number-valued field from an object representing a filter.
<span class='linenumber'>438</span> * @param {!Object} bareObject The object representing the filter.
<span class='linenumber'>439</span> * @param {string} field The name of the field.
<span class='linenumber'>440</span> * @return {number} The field value.
<span class='linenumber'>441</span> * @private
<span class='linenumber'>442</span> */</span><span class="WHIT">
<span class='linenumber'>443</span> </span><span class="NAME">bidichecker.FilterFactory.getNumberParam_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>444</span> </span><span class="NAME">bidichecker.FilterFactory.checkParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>445</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="COMM">/** @type {number} */</span><span class="WHIT"> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="NAME">field</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>446</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>447</span>
<span class='linenumber'>448</span>
<span class='linenumber'>449</span> </span><span class="COMM">/**
<span class='linenumber'>450</span> * Reads a regular expression field from an object representing a filter.
<span class='linenumber'>451</span> * The field contents must be a string or a RegExp object.
<span class='linenumber'>452</span> * @param {!Object} bareObject The object representing the filter.
<span class='linenumber'>453</span> * @param {string} fieldName The name of the field.
<span class='linenumber'>454</span> * @return {!RegExp} A regular expression anchored at both ends of the string.
<span class='linenumber'>455</span> * @private
<span class='linenumber'>456</span> */</span><span class="WHIT">
<span class='linenumber'>457</span> </span><span class="NAME">bidichecker.FilterFactory.getRegexpParam_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>458</span> </span><span class="NAME">bidichecker.FilterFactory.checkParamExists_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>459</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="NAME">fieldName</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>460</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pattern</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>461</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>462</span> </span><span class="NAME">pattern</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="COMM">/** @type {string} */</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>463</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">field</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>464</span> </span><span class="NAME">pattern</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">field.source</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>465</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>466</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Wrong type for \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">fieldName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' parameter of \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>467</span> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="STRN">'opcode'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' filter; expected string or RegExp'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>468</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>469</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">'^('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pattern</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')$'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>470</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>471</span>
<span class='linenumber'>472</span>
<span class='linenumber'>473</span> </span><span class="COMM">/**
<span class='linenumber'>474</span> * Reads a field representing a subfilter from an object representing a filter.
<span class='linenumber'>475</span> * The field contents can either be a bare object representing a serialized
<span class='linenumber'>476</span> * filter, or an object supporting an <code>isSuppressed()</code> method.
<span class='linenumber'>477</span> * @param {!Object} bareObject The object representing the filter.
<span class='linenumber'>478</span> * @param {string} field The name of the field.
<span class='linenumber'>479</span> * @return {!bidichecker.FilterFactory.ComposableFilter} A filter constructed
<span class='linenumber'>480</span> * from the field's contents.
<span class='linenumber'>481</span> * @private
<span class='linenumber'>482</span> */</span><span class="WHIT">
<span class='linenumber'>483</span> </span><span class="NAME">bidichecker.FilterFactory.getFilterParam_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>484</span> </span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>485</span> </span><span class="NAME">bidichecker.FilterFactory.checkParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>486</span>
<span class='linenumber'>487</span> </span><span class="COMM">// Recursively build any subfilters referred to by this one.</span><span class="WHIT">
<span class='linenumber'>488</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">subfilterObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="NAME">field</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>489</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">subfilterObject</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>490</span> </span><span class="COMM">// Found a constructed filter object.</span><span class="WHIT">
<span class='linenumber'>491</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">subfilterObject</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>492</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">subfilterObject</span><span class="PUNC">[</span><span class="STRN">'opcode'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>493</span> </span><span class="COMM">// Found a raw filter object.</span><span class="WHIT">
<span class='linenumber'>494</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.constructFilter_</span><span class="PUNC">(</span><span class="NAME">subfilterObject</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>495</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>496</span> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'Can\'t make a filter out of the \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' parameter of \''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>497</span> </span><span class="NAME">bareObject</span><span class="PUNC">[</span><span class="STRN">'opcode'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'\' filter'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>498</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>499</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>500</span>
<span class='linenumber'>501</span>
<span class='linenumber'>502</span> </span><span class="COMM">/**
<span class='linenumber'>503</span> * A filter which suppresses errors by and-ing component filters.
<span class='linenumber'>504</span> * @param {!Object} bareObject An object containing 'filter1' and 'filter2'
<span class='linenumber'>505</span> * fields, each containing a bare object representing a component filter.
<span class='linenumber'>506</span> * @constructor
<span class='linenumber'>507</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>508</span> * @private
<span class='linenumber'>509</span> */</span><span class="WHIT">
<span class='linenumber'>510</span> </span><span class="NAME">bidichecker.FilterFactory.AndFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>511</span> </span><span class="COMM">/**
<span class='linenumber'>512</span> * @type {!bidichecker.Filter}
<span class='linenumber'>513</span> * @private
<span class='linenumber'>514</span> */</span><span class="WHIT">
<span class='linenumber'>515</span> </span><span class="NAME">this.filter1_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>516</span> </span><span class="NAME">bidichecker.FilterFactory.getFilterParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'filter1'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>517</span>
<span class='linenumber'>518</span> </span><span class="COMM">/**
<span class='linenumber'>519</span> * @type {!bidichecker.Filter}
<span class='linenumber'>520</span> * @private
<span class='linenumber'>521</span> */</span><span class="WHIT">
<span class='linenumber'>522</span> </span><span class="NAME">this.filter2_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>523</span> </span><span class="NAME">bidichecker.FilterFactory.getFilterParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'filter2'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>524</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>525</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.AndFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>526</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>527</span>
<span class='linenumber'>528</span>
<span class='linenumber'>529</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>530</span> </span><span class="NAME">bidichecker.FilterFactory.AndFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>531</span> </span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>532</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.filter1_.isSuppressed</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='linenumber'>533</span> </span><span class="NAME">this.filter2_.isSuppressed</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>534</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>535</span>
<span class='linenumber'>536</span>
<span class='linenumber'>537</span> </span><span class="COMM">/**
<span class='linenumber'>538</span> * A filter which suppresses errors by a literal match of their <code>atText</code>
<span class='linenumber'>539</span> * fields.
<span class='linenumber'>540</span> * @param {!Object} bareObject An object containing an 'atText' field, which
<span class='linenumber'>541</span> * must match the entire <code>atText</code> field value. If empty, will only
<span class='linenumber'>542</span> * match an empty or null <code>atText</code>.
<span class='linenumber'>543</span> * @constructor
<span class='linenumber'>544</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>545</span> * @private
<span class='linenumber'>546</span> */</span><span class="WHIT">
<span class='linenumber'>547</span> </span><span class="NAME">bidichecker.FilterFactory.AtTextFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>548</span> </span><span class="COMM">/**
<span class='linenumber'>549</span> * @type {string}
<span class='linenumber'>550</span> * @private
<span class='linenumber'>551</span> */</span><span class="WHIT">
<span class='linenumber'>552</span> </span><span class="NAME">this.atText_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>553</span> </span><span class="NAME">bidichecker.FilterFactory.getStringParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'atText'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>554</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>555</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.AtTextFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>556</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>557</span>
<span class='linenumber'>558</span>
<span class='linenumber'>559</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>560</span> </span><span class="NAME">bidichecker.FilterFactory.AtTextFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>561</span> </span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>562</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.atText_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">error.getAtText</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>563</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>564</span>
<span class='linenumber'>565</span>
<span class='linenumber'>566</span> </span><span class="COMM">/**
<span class='linenumber'>567</span> * A filter which suppresses errors by applying a regular expression to their
<span class='linenumber'>568</span> * <code>atText</code> fields.
<span class='linenumber'>569</span> * @param {!Object} bareObject An object containing an 'atTextRegexp' field
<span class='linenumber'>570</span> * containing a regular expression, which must match the entire
<span class='linenumber'>571</span> * <code>atText</code> field value. If empty, will only match an empty or null
<span class='linenumber'>572</span> * <code>atText</code>.
<span class='linenumber'>573</span> * @constructor
<span class='linenumber'>574</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>575</span> * @private
<span class='linenumber'>576</span> */</span><span class="WHIT">
<span class='linenumber'>577</span> </span><span class="NAME">bidichecker.FilterFactory.AtTextRegexpFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>578</span> </span><span class="COMM">/**
<span class='linenumber'>579</span> * @type {!RegExp}
<span class='linenumber'>580</span> * @private
<span class='linenumber'>581</span> */</span><span class="WHIT">
<span class='linenumber'>582</span> </span><span class="NAME">this.atTextRegexp_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>583</span> </span><span class="NAME">bidichecker.FilterFactory.getRegexpParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'atTextRegexp'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>584</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>585</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.AtTextRegexpFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>586</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>587</span>
<span class='linenumber'>588</span>
<span class='linenumber'>589</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>590</span> </span><span class="NAME">bidichecker.FilterFactory.AtTextRegexpFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>591</span> </span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>592</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.atTextRegexp_.test</span><span class="PUNC">(</span><span class="NAME">error.getAtText</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>593</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>594</span>
<span class='linenumber'>595</span>
<span class='linenumber'>596</span> </span><span class="COMM">/**
<span class='linenumber'>597</span> * A filter which suppresses errors by a literal match of their {@code
<span class='linenumber'>598</span> * followedByText} fields.
<span class='linenumber'>599</span> * @param {!Object} bareObject An object containing a 'followedByText' field,
<span class='linenumber'>600</span> * which must match the entire <code>followedByText</code> field value. If empty,
<span class='linenumber'>601</span> * will only match an empty or null <code>followedByText</code>.
<span class='linenumber'>602</span> * @constructor
<span class='linenumber'>603</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>604</span> * @private
<span class='linenumber'>605</span> */</span><span class="WHIT">
<span class='linenumber'>606</span> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>607</span> </span><span class="COMM">/**
<span class='linenumber'>608</span> * @type {string}
<span class='linenumber'>609</span> * @private
<span class='linenumber'>610</span> */</span><span class="WHIT">
<span class='linenumber'>611</span> </span><span class="NAME">this.followedByText_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>612</span> </span><span class="NAME">bidichecker.FilterFactory.getStringParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'followedByText'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>613</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>614</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.FollowedByTextFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>615</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>616</span>
<span class='linenumber'>617</span>
<span class='linenumber'>618</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>619</span> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>620</span> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>621</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.followedByText_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">error.getFollowedByText</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>622</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>623</span>
<span class='linenumber'>624</span>
<span class='linenumber'>625</span> </span><span class="COMM">/**
<span class='linenumber'>626</span> * A filter which suppresses errors by applying a regular expression to their
<span class='linenumber'>627</span> * <code>followedByText</code> fields.
<span class='linenumber'>628</span> * @param {!Object} bareObject An object containing a 'followedByTextRegexp'
<span class='linenumber'>629</span> * field containing a regular expression, which must match the entire
<span class='linenumber'>630</span> * <code>followedByText</code> field value. If empty, will only match an empty or
<span class='linenumber'>631</span> * null <code>followedByText</code>.
<span class='linenumber'>632</span> * @constructor
<span class='linenumber'>633</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>634</span> * @private
<span class='linenumber'>635</span> */</span><span class="WHIT">
<span class='linenumber'>636</span> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextRegexpFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>637</span> </span><span class="COMM">/**
<span class='linenumber'>638</span> * @type {!RegExp}
<span class='linenumber'>639</span> * @private
<span class='linenumber'>640</span> */</span><span class="WHIT">
<span class='linenumber'>641</span> </span><span class="NAME">this.followedByTextRegexp_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>642</span> </span><span class="NAME">bidichecker.FilterFactory.getRegexpParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>643</span> </span><span class="STRN">'followedByTextRegexp'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>644</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>645</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.FollowedByTextRegexpFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>646</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>647</span>
<span class='linenumber'>648</span>
<span class='linenumber'>649</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>650</span> </span><span class="NAME">bidichecker.FilterFactory.FollowedByTextRegexpFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>651</span> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>652</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.followedByTextRegexp_.test</span><span class="PUNC">(</span><span class="NAME">error.getFollowedByText</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>653</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>654</span>
<span class='linenumber'>655</span>
<span class='linenumber'>656</span> </span><span class="COMM">/**
<span class='linenumber'>657</span> * A filter which suppresses errors by a literal match of the error location's
<span class='linenumber'>658</span> * (or one of its DOM ancestors') <code>class</code> name.
<span class='linenumber'>659</span> * @param {!Object} bareObject An object containing a 'className' field, which
<span class='linenumber'>660</span> * must match one of the class names in the <code>class</code> attribute of the
<span class='linenumber'>661</span> * location or one of its ancestors.
<span class='linenumber'>662</span> * @constructor
<span class='linenumber'>663</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>664</span> * @private
<span class='linenumber'>665</span> */</span><span class="WHIT">
<span class='linenumber'>666</span> </span><span class="NAME">bidichecker.FilterFactory.LocationClassFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>667</span> </span><span class="COMM">/**
<span class='linenumber'>668</span> * @type {string}
<span class='linenumber'>669</span> * @private
<span class='linenumber'>670</span> */</span><span class="WHIT">
<span class='linenumber'>671</span> </span><span class="NAME">this.className_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>672</span> </span><span class="NAME">bidichecker.FilterFactory.getStringParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'className'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>673</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>674</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.LocationClassFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>675</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>676</span>
<span class='linenumber'>677</span>
<span class='linenumber'>678</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>679</span> </span><span class="NAME">bidichecker.FilterFactory.LocationClassFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>680</span> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>681</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">locationElements.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>682</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">current</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>683</span> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">current.parentNode</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>684</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">current.className</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>685</span> </span><span class="COMM">// Match each whitespace-separated class name separately.</span><span class="WHIT">
<span class='linenumber'>686</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">classNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">current.className.split</span><span class="PUNC">(</span><span class="REGX">/\s/</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>687</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">classNames.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>688</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.className_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">classNames</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>689</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>690</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>691</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>692</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>693</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>694</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>695</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>696</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>697</span>
<span class='linenumber'>698</span>
<span class='linenumber'>699</span> </span><span class="COMM">/**
<span class='linenumber'>700</span> * A filter which suppresses errors by applying a regular expression to the
<span class='linenumber'>701</span> * error location's (or one of its DOM ancestors') <code>class</code> name.
<span class='linenumber'>702</span> * @param {!Object} bareObject An object containing a 'classRegexp' field,
<span class='linenumber'>703</span> * containing a regular expression which must match one of the class names
<span class='linenumber'>704</span> * in the <code>class</code> attribute of the location or one of its ancestors.
<span class='linenumber'>705</span> * @constructor
<span class='linenumber'>706</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>707</span> * @private
<span class='linenumber'>708</span> */</span><span class="WHIT">
<span class='linenumber'>709</span> </span><span class="NAME">bidichecker.FilterFactory.LocationClassRegexpFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>710</span> </span><span class="COMM">/**
<span class='linenumber'>711</span> * @type {!RegExp}
<span class='linenumber'>712</span> * @private
<span class='linenumber'>713</span> */</span><span class="WHIT">
<span class='linenumber'>714</span> </span><span class="NAME">this.classRegexp_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>715</span> </span><span class="NAME">bidichecker.FilterFactory.getRegexpParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'classRegexp'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>716</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>717</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.LocationClassRegexpFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>718</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>719</span>
<span class='linenumber'>720</span>
<span class='linenumber'>721</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>722</span> </span><span class="NAME">bidichecker.FilterFactory.LocationClassRegexpFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>723</span> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>724</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">locationElements.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>725</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">current</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>726</span> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">current.parentNode</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>727</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">current.className</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>728</span> </span><span class="COMM">// Match each whitespace-separated class name separately.</span><span class="WHIT">
<span class='linenumber'>729</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">classNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">current.className.split</span><span class="PUNC">(</span><span class="REGX">/\s/</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>730</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">classNames.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>731</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.classRegexp_.test</span><span class="PUNC">(</span><span class="NAME">classNames</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>732</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>733</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>734</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>735</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>736</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>737</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>738</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>739</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>740</span>
<span class='linenumber'>741</span>
<span class='linenumber'>742</span> </span><span class="COMM">/**
<span class='linenumber'>743</span> * A filter which suppresses errors by a literal match of the error location's
<span class='linenumber'>744</span> * (or one of its DOM ancestors') <code>id</code> attribute.
<span class='linenumber'>745</span> * @param {!Object} bareObject An object containing an 'id' field, which must
<span class='linenumber'>746</span> * match the <code>id</code> attribute of the location or one of its ancestors.
<span class='linenumber'>747</span> * @constructor
<span class='linenumber'>748</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>749</span> * @private
<span class='linenumber'>750</span> */</span><span class="WHIT">
<span class='linenumber'>751</span> </span><span class="NAME">bidichecker.FilterFactory.LocationIdFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>752</span> </span><span class="COMM">/**
<span class='linenumber'>753</span> * @type {string}
<span class='linenumber'>754</span> * @private
<span class='linenumber'>755</span> */</span><span class="WHIT">
<span class='linenumber'>756</span> </span><span class="NAME">this.id_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bidichecker.FilterFactory.getStringParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'id'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>757</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>758</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.LocationIdFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>759</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>760</span>
<span class='linenumber'>761</span>
<span class='linenumber'>762</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>763</span> </span><span class="NAME">bidichecker.FilterFactory.LocationIdFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>764</span> </span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>765</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">locationElements.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>766</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">current</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>767</span> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">current.parentNode</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>768</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">current.id</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.id_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">current.id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>769</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>770</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>771</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>772</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>773</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>774</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>775</span>
<span class='linenumber'>776</span>
<span class='linenumber'>777</span> </span><span class="COMM">/**
<span class='linenumber'>778</span> * A filter which suppresses errors by applying a regular expression to the
<span class='linenumber'>779</span> * error location's (or one of its DOM ancestors') <code>id</code> attribute.
<span class='linenumber'>780</span> * @param {!Object} bareObject An object containing an 'idRegexp' field
<span class='linenumber'>781</span> * containing a regular expression, which must match the <code>id</code>
<span class='linenumber'>782</span> * attribute of the location or one of its ancestors.
<span class='linenumber'>783</span> * @constructor
<span class='linenumber'>784</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>785</span> * @private
<span class='linenumber'>786</span> */</span><span class="WHIT">
<span class='linenumber'>787</span> </span><span class="NAME">bidichecker.FilterFactory.LocationIdRegexpFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>788</span> </span><span class="COMM">/**
<span class='linenumber'>789</span> * @type {!RegExp}
<span class='linenumber'>790</span> * @private
<span class='linenumber'>791</span> */</span><span class="WHIT">
<span class='linenumber'>792</span> </span><span class="NAME">this.idRegexp_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>793</span> </span><span class="NAME">bidichecker.FilterFactory.getRegexpParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'idRegexp'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>794</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>795</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.LocationIdRegexpFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>796</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>797</span>
<span class='linenumber'>798</span>
<span class='linenumber'>799</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>800</span> </span><span class="NAME">bidichecker.FilterFactory.LocationIdRegexpFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>801</span> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>802</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">locationElements.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>803</span> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">current</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>804</span> </span><span class="NAME">current</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">current.parentNode</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>805</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">current.id</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.idRegexp_.test</span><span class="PUNC">(</span><span class="NAME">current.id</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>806</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>807</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>808</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>809</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>810</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>811</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>812</span>
<span class='linenumber'>813</span>
<span class='linenumber'>814</span> </span><span class="COMM">/**
<span class='linenumber'>815</span> * A filter which suppresses errors by inverting another filter.
<span class='linenumber'>816</span> * @param {!Object} bareObject An object containing a 'filter' field, containing
<span class='linenumber'>817</span> * a bare object representing a component filter.
<span class='linenumber'>818</span> * @constructor
<span class='linenumber'>819</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>820</span> * @private
<span class='linenumber'>821</span> */</span><span class="WHIT">
<span class='linenumber'>822</span> </span><span class="NAME">bidichecker.FilterFactory.NotFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>823</span> </span><span class="COMM">/**
<span class='linenumber'>824</span> * @type {!bidichecker.Filter}
<span class='linenumber'>825</span> * @private
<span class='linenumber'>826</span> */</span><span class="WHIT">
<span class='linenumber'>827</span> </span><span class="NAME">this.filter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='linenumber'>828</span> </span><span class="NAME">bidichecker.FilterFactory.getFilterParam_</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'filter'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>829</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>830</span> </span><span class="NAME">goog.inherits</span><span class="PUNC">(</span><span class="NAME">bidichecker.FilterFactory.NotFilter_</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>831</span> </span><span class="NAME">bidichecker.FilterFactory.ComposableFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>832</span>
<span class='linenumber'>833</span>
<span class='linenumber'>834</span> </span><span class="COMM">/** @inheritDoc */</span><span class="WHIT">
<span class='linenumber'>835</span> </span><span class="NAME">bidichecker.FilterFactory.NotFilter_.prototype.isSuppressed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT">
<span class='linenumber'>836</span> </span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>837</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.filter_.isSuppressed</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locationElements</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>838</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>839</span>
<span class='linenumber'>840</span>
<span class='linenumber'>841</span> </span><span class="COMM">/**
<span class='linenumber'>842</span> * A filter which suppresses errors by or-ing component filters.
<span class='linenumber'>843</span> * @param {!Object} bareObject An object containing 'filter1' and 'filter2'
<span class='linenumber'>844</span> * fields, each containing a bare object representing a component filter.
<span class='linenumber'>845</span> * @constructor
<span class='linenumber'>846</span> * @extends {bidichecker.FilterFactory.ComposableFilter}
<span class='linenumber'>847</span> * @private
<span class='linenumber'>848</span> */</span><span class="WHIT">
<span class='linenumber'>849</span> </span><span class="NAME">bidichecker.FilterFactory.OrFilter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">bareObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>850</span> </span><span class="COMM">/**