Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: webkit/port/bindings/v8/v8_nodefilter.cpp

Issue 4097: Implement better JS exception handling by abstracting KJS::ExecState into an ... (Closed) Base URL: svn://chrome-svn/chrome/branches/chrome_webkit_merge_branch/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/port/bindings/v8/v8_nodefilter.h ('k') | webkit/port/bridge/ExceptionContextV8.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/v8/v8_nodefilter.cpp
===================================================================
--- webkit/port/bindings/v8/v8_nodefilter.cpp (revision 2614)
+++ webkit/port/bindings/v8/v8_nodefilter.cpp (working copy)
@@ -31,6 +31,7 @@
#include "v8_nodefilter.h"
#include "v8_proxy.h"
+#include "ExceptionContext.h"
#include "NodeFilter.h"
#include "Node.h"
@@ -51,15 +52,17 @@
m_filter.Clear();
}
-short V8NodeFilterCondition::acceptNode(Node* node) const {
+short V8NodeFilterCondition::acceptNode(ExceptionContext* exception_context,
+ Node* node) const {
ASSERT(v8::Context::InContext());
if (!m_filter->IsFunction()) return NodeFilter::FILTER_ACCEPT;
- v8::TryCatch exception_catcher;
+ ExceptionCatcher exception_catcher(exception_context);
v8::Handle<v8::Object> this_obj = v8::Context::GetCurrent()->Global();
- v8::Handle<v8::Function> callback = v8::Handle<v8::Function>::Cast(m_filter);
+ v8::Handle<v8::Function> callback =
+ v8::Handle<v8::Function>::Cast(m_filter);
v8::Handle<v8::Value>* args = new v8::Handle<v8::Value>[1];
args[0] = V8Proxy::ToV8Object(V8ClassIndex::NODE, node);
@@ -70,9 +73,7 @@
proxy->CallFunction(callback, this_obj, 1, args);
delete[] args;
- // TODO(fqian): this code can be removed when issue 1042294 is fixed.
- // See also 1068243.
- if (exception_catcher.HasCaught()) {
+ if (exception_context->hadException()) {
return NodeFilter::FILTER_REJECT;
}
« no previous file with comments | « webkit/port/bindings/v8/v8_nodefilter.h ('k') | webkit/port/bridge/ExceptionContextV8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698