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

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

Issue 105693002: Generate a bit less code to handle failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years 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
Index: Source/bindings/v8/custom/V8SVGLengthCustom.cpp
diff --git a/Source/bindings/v8/custom/V8SVGLengthCustom.cpp b/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
index 94a7948be933c1760b5e4234722bf5edf00805ac..a5a1cfef55bc868a65f2fc7c6a92390a1d132603 100644
--- a/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -76,19 +76,21 @@ void V8SVGLength::valueAttributeSetterCustom(v8::Local<v8::Value> value, const v
void V8SVGLength::convertToSpecifiedUnitsMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "convertToSpecifiedUnits", "SVGLength", info.Holder(), info.GetIsolate());
SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
if (wrapper->isReadOnly()) {
- setDOMException(NoModificationAllowedError, info.GetIsolate());
+ exceptionState.throwDOMException(NoModificationAllowedError, "The length is read only.");
+ exceptionState.throwIfNeeded();
return;
}
if (info.Length() < 1) {
- throwTypeError(ExceptionMessages::failedToExecute("convertToSpecifiedUnits", "SVGLength", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+ exceptionState.throwIfNeeded();
return;
}
SVGLength& imp = wrapper->propertyReference();
- ExceptionState exceptionState(info.Holder(), info.GetIsolate());
V8TRYCATCH_VOID(int, unitType, toUInt32(info[0]));
SVGLengthContext lengthContext(wrapper->contextElement());
imp.convertToSpecifiedUnits(unitType, lengthContext, exceptionState);
« no previous file with comments | « Source/bindings/v8/custom/V8MutationObserverCustom.cpp ('k') | Source/bindings/v8/custom/V8TextTrackCueCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698