| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Catch exceptions from calling the namespace resolver. | 74 // Catch exceptions from calling the namespace resolver. |
| 75 v8::TryCatch tryCatch; | 75 v8::TryCatch tryCatch; |
| 76 tryCatch.SetVerbose(true); // Print exceptions to console. | 76 tryCatch.SetVerbose(true); // Print exceptions to console. |
| 77 | 77 |
| 78 const int argc = 1; | 78 const int argc = 1; |
| 79 v8::Local<v8::Value> argv[argc] = { v8String(m_isolate, prefix) }; | 79 v8::Local<v8::Value> argv[argc] = { v8String(m_isolate, prefix) }; |
| 80 v8::Local<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Lo
cal<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc; | 80 v8::Local<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Lo
cal<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc; |
| 81 | 81 |
| 82 v8::Local<v8::Value> retval = ScriptController::callFunction(callingExecutio
nContext(m_isolate), function, m_resolver, argc, argv, m_isolate); | 82 v8::Local<v8::Value> retval; |
| 83 | |
| 84 // Eat exceptions from namespace resolver and return an empty string. This w
ill most likely cause NamespaceError. | 83 // Eat exceptions from namespace resolver and return an empty string. This w
ill most likely cause NamespaceError. |
| 85 if (tryCatch.HasCaught()) | 84 if (!ScriptController::callFunction(callingExecutionContext(m_isolate), func
tion, m_resolver, argc, argv, m_isolate).ToLocal(&retval)) |
| 86 return nullAtom; | 85 return nullAtom; |
| 87 | 86 |
| 88 TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, returnString, retv
al, nullAtom); | 87 TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, returnString, retv
al, nullAtom); |
| 89 return returnString; | 88 return returnString; |
| 90 } | 89 } |
| 91 | 90 |
| 92 DEFINE_TRACE(V8CustomXPathNSResolver) | 91 DEFINE_TRACE(V8CustomXPathNSResolver) |
| 93 { | 92 { |
| 94 XPathNSResolver::trace(visitor); | 93 XPathNSResolver::trace(visitor); |
| 95 } | 94 } |
| 96 | 95 |
| 97 } // namespace blink | 96 } // namespace blink |
| OLD | NEW |