| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 v8::Isolate* isolate = m_scriptState->isolate(); | 62 v8::Isolate* isolate = m_scriptState->isolate(); |
| 63 ASSERT(!m_scriptState->context().IsEmpty()); | 63 ASSERT(!m_scriptState->context().IsEmpty()); |
| 64 v8::HandleScope handleScope(isolate); | 64 v8::HandleScope handleScope(isolate); |
| 65 v8::Handle<v8::Value> filter = m_filter.newLocal(isolate); | 65 v8::Handle<v8::Value> filter = m_filter.newLocal(isolate); |
| 66 | 66 |
| 67 ASSERT(filter.IsEmpty() || filter->IsObject()); | 67 ASSERT(filter.IsEmpty() || filter->IsObject()); |
| 68 if (filter.IsEmpty()) | 68 if (filter.IsEmpty()) |
| 69 return NodeFilter::FILTER_ACCEPT; | 69 return NodeFilter::FILTER_ACCEPT; |
| 70 | 70 |
| 71 v8::TryCatch exceptionCatcher; | 71 v8::TryCatch exceptionCatcher; |
| 72 V8RethrowTryCatchScope rethrow(exceptionCatcher); |
| 72 | 73 |
| 73 v8::Handle<v8::Function> callback; | 74 v8::Handle<v8::Function> callback; |
| 74 if (filter->IsFunction()) | 75 if (filter->IsFunction()) |
| 75 callback = v8::Handle<v8::Function>::Cast(filter); | 76 callback = v8::Handle<v8::Function>::Cast(filter); |
| 76 else { | 77 else { |
| 77 v8::Local<v8::Value> value = filter->ToObject()->Get(v8AtomicString(isol
ate, "acceptNode")); | 78 v8::Local<v8::Value> value = filter->ToObject()->Get(v8AtomicString(isol
ate, "acceptNode")); |
| 78 if (value.IsEmpty() || !value->IsFunction()) { | 79 if (value.IsEmpty() || !value->IsFunction()) { |
| 79 throwTypeError("NodeFilter object does not have an acceptNode functi
on", isolate); | 80 throwTypeError("NodeFilter object does not have an acceptNode functi
on", isolate); |
| 80 return NodeFilter::FILTER_REJECT; | 81 return NodeFilter::FILTER_REJECT; |
| 81 } | 82 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 97 | 98 |
| 98 return result->Int32Value(); | 99 return result->Int32Value(); |
| 99 } | 100 } |
| 100 | 101 |
| 101 void V8NodeFilterCondition::setWeakCallback(const v8::WeakCallbackData<v8::Value
, V8NodeFilterCondition>& data) | 102 void V8NodeFilterCondition::setWeakCallback(const v8::WeakCallbackData<v8::Value
, V8NodeFilterCondition>& data) |
| 102 { | 103 { |
| 103 data.GetParameter()->m_filter.clear(); | 104 data.GetParameter()->m_filter.clear(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 } // namespace WebCore | 107 } // namespace WebCore |
| OLD | NEW |