Commit 7c459465 authored by ishell@chromium.org's avatar ishell@chromium.org

Hydrogen filter now supports trailing wildcard in negative filter.

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/145663008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18851 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2c5c0817
......@@ -9862,11 +9862,18 @@ bool JSFunction::PassesFilter(const char* raw_filter) {
Vector<const char> filter = CStrVector(raw_filter);
if (filter.length() == 0) return name->length() == 0;
if (filter[0] == '-') {
// Negative filter.
if (filter.length() == 1) {
return (name->length() != 0);
} else if (!name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
return true;
} else if (name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
return false;
}
if (filter[filter.length() - 1] == '*' &&
name->IsUtf8EqualTo(filter.SubVector(1, filter.length() - 1), true)) {
return false;
}
return true;
} else if (name->IsUtf8EqualTo(filter)) {
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment