| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 return regexObject; | 1107 return regexObject; |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 /** | 1110 /** |
| 1111 * @param {string} query | 1111 * @param {string} query |
| 1112 * @param {string=} flags | 1112 * @param {string=} flags |
| 1113 * @return {!RegExp} | 1113 * @return {!RegExp} |
| 1114 */ | 1114 */ |
| 1115 function createPlainTextSearchRegex(query, flags) | 1115 function createPlainTextSearchRegex(query, flags) |
| 1116 { | 1116 { |
| 1117 // This should be kept the same as the one in V8StringUtil.cpp. | 1117 // This should be kept the same as the one in StringUtil.cpp. |
| 1118 var regexSpecialCharacters = String.regexSpecialCharacters(); | 1118 var regexSpecialCharacters = String.regexSpecialCharacters(); |
| 1119 var regex = ""; | 1119 var regex = ""; |
| 1120 for (var i = 0; i < query.length; ++i) { | 1120 for (var i = 0; i < query.length; ++i) { |
| 1121 var c = query.charAt(i); | 1121 var c = query.charAt(i); |
| 1122 if (regexSpecialCharacters.indexOf(c) !== -1) | 1122 if (regexSpecialCharacters.indexOf(c) !== -1) |
| 1123 regex += "\\"; | 1123 regex += "\\"; |
| 1124 regex += c; | 1124 regex += c; |
| 1125 } | 1125 } |
| 1126 return new RegExp(regex, flags || ""); | 1126 return new RegExp(regex, flags || ""); |
| 1127 } | 1127 } |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1531 while (rightIndex < rightKeys.length) { | 1531 while (rightIndex < rightKeys.length) { |
| 1532 var rightKey = rightKeys[rightIndex++]; | 1532 var rightKey = rightKeys[rightIndex++]; |
| 1533 added.push(other.get(rightKey)); | 1533 added.push(other.get(rightKey)); |
| 1534 } | 1534 } |
| 1535 return { | 1535 return { |
| 1536 added: added, | 1536 added: added, |
| 1537 removed: removed, | 1537 removed: removed, |
| 1538 equal: equal | 1538 equal: equal |
| 1539 } | 1539 } |
| 1540 } | 1540 } |
| OLD | NEW |