OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 9844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9855 // "-name" all but the function "name" | 9855 // "-name" all but the function "name" |
9856 // "" only the top-level function | 9856 // "" only the top-level function |
9857 // "name" only the function "name" | 9857 // "name" only the function "name" |
9858 // "name*" only functions starting with "name" | 9858 // "name*" only functions starting with "name" |
9859 bool JSFunction::PassesFilter(const char* raw_filter) { | 9859 bool JSFunction::PassesFilter(const char* raw_filter) { |
9860 if (*raw_filter == '*') return true; | 9860 if (*raw_filter == '*') return true; |
9861 String* name = shared()->DebugName(); | 9861 String* name = shared()->DebugName(); |
9862 Vector<const char> filter = CStrVector(raw_filter); | 9862 Vector<const char> filter = CStrVector(raw_filter); |
9863 if (filter.length() == 0) return name->length() == 0; | 9863 if (filter.length() == 0) return name->length() == 0; |
9864 if (filter[0] == '-') { | 9864 if (filter[0] == '-') { |
| 9865 // Negative filter. |
9865 if (filter.length() == 1) { | 9866 if (filter.length() == 1) { |
9866 return (name->length() != 0); | 9867 return (name->length() != 0); |
9867 } else if (!name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { | 9868 } else if (name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { |
9868 return true; | 9869 return false; |
9869 } | 9870 } |
| 9871 if (filter[filter.length() - 1] == '*' && |
| 9872 name->IsUtf8EqualTo(filter.SubVector(1, filter.length() - 1), true)) { |
| 9873 return false; |
| 9874 } |
| 9875 return true; |
| 9876 |
9870 } else if (name->IsUtf8EqualTo(filter)) { | 9877 } else if (name->IsUtf8EqualTo(filter)) { |
9871 return true; | 9878 return true; |
9872 } | 9879 } |
9873 if (filter[filter.length() - 1] == '*' && | 9880 if (filter[filter.length() - 1] == '*' && |
9874 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { | 9881 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { |
9875 return true; | 9882 return true; |
9876 } | 9883 } |
9877 return false; | 9884 return false; |
9878 } | 9885 } |
9879 | 9886 |
(...skipping 6537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16417 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16424 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16418 static const char* error_messages_[] = { | 16425 static const char* error_messages_[] = { |
16419 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16426 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16420 }; | 16427 }; |
16421 #undef ERROR_MESSAGES_TEXTS | 16428 #undef ERROR_MESSAGES_TEXTS |
16422 return error_messages_[reason]; | 16429 return error_messages_[reason]; |
16423 } | 16430 } |
16424 | 16431 |
16425 | 16432 |
16426 } } // namespace v8::internal | 16433 } } // namespace v8::internal |
OLD | NEW |