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 9886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9897 // "-" all but the top-level function | 9897 // "-" all but the top-level function |
9898 // "-name" all but the function "name" | 9898 // "-name" all but the function "name" |
9899 // "" only the top-level function | 9899 // "" only the top-level function |
9900 // "name" only the function "name" | 9900 // "name" only the function "name" |
9901 // "name*" only functions starting with "name" | 9901 // "name*" only functions starting with "name" |
9902 bool JSFunction::PassesFilter(const char* raw_filter) { | 9902 bool JSFunction::PassesFilter(const char* raw_filter) { |
9903 if (*raw_filter == '*') return true; | 9903 if (*raw_filter == '*') return true; |
9904 String* name = shared()->DebugName(); | 9904 String* name = shared()->DebugName(); |
9905 Vector<const char> filter = CStrVector(raw_filter); | 9905 Vector<const char> filter = CStrVector(raw_filter); |
9906 if (filter.length() == 0) return name->length() == 0; | 9906 if (filter.length() == 0) return name->length() == 0; |
9907 if (filter[0] != '-' && name->IsUtf8EqualTo(filter)) return true; | 9907 if (filter[0] == '-') { |
9908 if (filter[0] == '-' && | 9908 if (filter.length() == 1) { |
9909 !name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { | 9909 return (name->length() != 0); |
| 9910 } else if (!name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { |
| 9911 return true; |
| 9912 } |
| 9913 } else if (name->IsUtf8EqualTo(filter)) { |
9910 return true; | 9914 return true; |
9911 } | 9915 } |
9912 if (filter[filter.length() - 1] == '*' && | 9916 if (filter[filter.length() - 1] == '*' && |
9913 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { | 9917 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { |
9914 return true; | 9918 return true; |
9915 } | 9919 } |
9916 return false; | 9920 return false; |
9917 } | 9921 } |
9918 | 9922 |
9919 | 9923 |
(...skipping 6478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16398 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16402 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16399 static const char* error_messages_[] = { | 16403 static const char* error_messages_[] = { |
16400 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16404 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16401 }; | 16405 }; |
16402 #undef ERROR_MESSAGES_TEXTS | 16406 #undef ERROR_MESSAGES_TEXTS |
16403 return error_messages_[reason]; | 16407 return error_messages_[reason]; |
16404 } | 16408 } |
16405 | 16409 |
16406 | 16410 |
16407 } } // namespace v8::internal | 16411 } } // namespace v8::internal |
OLD | NEW |