Commit 157a6e0b authored by haraken@chromium.org's avatar haraken@chromium.org

Add a missing check for exceptions thrown in methods implemented in private scripts

method.cpp misses a check for a returned value of a method implemented in a private script.
This CL adds the check. Other places already have the check.

(This call path is not yet used in production.)

BUG=341031

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179943 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent af2e1e4d
...@@ -363,7 +363,7 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame* ...@@ -363,7 +363,7 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame*
v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, "{{cpp_class}}", "{{attribute.name}}", holder); v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, "{{cpp_class}}", "{{attribute.name}}", holder);
if (block.HasCaught()) { if (block.HasCaught()) {
if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) { if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support exceptions other than DOM exceptions. // FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED(); RELEASE_ASSERT_NOT_REACHED();
} }
return false; return false;
...@@ -399,7 +399,7 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame* ...@@ -399,7 +399,7 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}}); PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}});
if (block.HasCaught()) { if (block.HasCaught()) {
if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) { if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support exceptions other than DOM exceptions. // FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED(); RELEASE_ASSERT_NOT_REACHED();
} }
return false; return false;
......
...@@ -565,14 +565,17 @@ bool {{v8_class}}::PrivateScript::{{method.name}}Method({{method.argument_declar ...@@ -565,14 +565,17 @@ bool {{v8_class}}::PrivateScript::{{method.name}}Method({{method.argument_declar
{% if method.idl_type == 'void' %} {% if method.idl_type == 'void' %}
PrivateScriptRunner::runDOMMethod(scriptState, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv); PrivateScriptRunner::runDOMMethod(scriptState, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv);
if (block.HasCaught()) { if (block.HasCaught()) {
PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception()); if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED();
}
return false; return false;
} }
{% else %} {% else %}
v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv); v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv);
if (block.HasCaught()) { if (block.HasCaught()) {
if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) { if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support exceptions other than DOM exceptions. // FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED(); RELEASE_ASSERT_NOT_REACHED();
} }
return false; return false;
......
...@@ -1670,7 +1670,7 @@ bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr ...@@ -1670,7 +1670,7 @@ bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr
v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplementedInPrivateScript", holder, 1, argv); v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplementedInPrivateScript", holder, 1, argv);
if (block.HasCaught()) { if (block.HasCaught()) {
if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) { if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support exceptions other than DOM exceptions. // FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED(); RELEASE_ASSERT_NOT_REACHED();
} }
return false; return false;
...@@ -1703,7 +1703,7 @@ bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(LocalFrame* ...@@ -1703,7 +1703,7 @@ bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(LocalFrame*
v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, "TestInterfaceImplementation", "stringAttribute", holder); v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, "TestInterfaceImplementation", "stringAttribute", holder);
if (block.HasCaught()) { if (block.HasCaught()) {
if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) { if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support exceptions other than DOM exceptions. // FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED(); RELEASE_ASSERT_NOT_REACHED();
} }
return false; return false;
...@@ -1736,7 +1736,7 @@ bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* ...@@ -1736,7 +1736,7 @@ bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame*
PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestInterfaceImplementation", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue)); PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestInterfaceImplementation", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue));
if (block.HasCaught()) { if (block.HasCaught()) {
if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) { if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptState->isolate(), exceptionState, block.Exception())) {
// FIXME: We should support exceptions other than DOM exceptions. // FIXME: We should support more exceptions.
RELEASE_ASSERT_NOT_REACHED(); RELEASE_ASSERT_NOT_REACHED();
} }
return false; return false;
......
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