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

Unified Diff: Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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 | « Source/bindings/v8/V8BindingMacros.h ('k') | Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
diff --git a/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp b/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
index 862d040c3b42dece31991fdbdc485b634488ca9d..2f1316207b8a26420b02c1b4e170b2362a43ad45 100644
--- a/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
@@ -26,6 +26,7 @@
#if ENABLE(WEB_AUDIO)
#include "V8BiquadFilterNode.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "modules/webaudio/BiquadFilterNode.h"
@@ -33,14 +34,17 @@ namespace WebCore {
void V8BiquadFilterNode::typeAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
+ ExceptionState exceptionState(ExceptionState::SetterContext, "type", "BiquadFilterNode", info.Holder(), info.GetIsolate());
BiquadFilterNode* imp = V8BiquadFilterNode::toNative(info.Holder());
if (value->IsNumber()) {
- bool ok = false;
- uint32_t type = toUInt32(value, ok);
- ASSERT(ok);
- if (!imp->setType(type))
- throwTypeError("Illegal BiquadFilterNode type", info.GetIsolate());
+ uint32_t type = toUInt32(value, exceptionState);
+ if (exceptionState.throwIfNeeded())
+ return;
+ if (!imp->setType(type)) {
+ exceptionState.throwTypeError("Illegal BiquadFilterNode type");
+ exceptionState.throwIfNeeded();
+ }
return;
}
@@ -52,7 +56,8 @@ void V8BiquadFilterNode::typeAttributeSetterCustom(v8::Local<v8::Value> value, c
}
}
- throwTypeError("Illegal BiquadFilterNode type", info.GetIsolate());
+ exceptionState.throwTypeError("Illegal BiquadFilterNode type");
+ exceptionState.throwIfNeeded();
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/V8BindingMacros.h ('k') | Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698