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

Unified Diff: Source/bindings/v8/custom/V8MutationObserverCustom.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
« no previous file with comments | « Source/bindings/v8/custom/V8CryptoCustom.cpp ('k') | Source/bindings/v8/custom/V8SVGLengthCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8MutationObserverCustom.cpp
diff --git a/Source/bindings/v8/custom/V8MutationObserverCustom.cpp b/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
index 60b65571d25420a24154fcc868960bee101e0b8c..f19d3eb52ff1fee3b5ce6cf2b07a59b3f09209a0 100644
--- a/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
+++ b/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
@@ -32,6 +32,7 @@
#include "V8MutationObserver.h"
#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8DOMWrapper.h"
#include "bindings/v8/V8MutationCallback.h"
@@ -42,14 +43,17 @@ namespace WebCore {
void V8MutationObserver::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ConstructionContext, "MutationObserver", info.Holder(), info.GetIsolate());
if (info.Length() < 1) {
- throwTypeError(ExceptionMessages::failedToConstruct("MutationObserver", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+ exceptionState.throwIfNeeded();
return;
}
v8::Local<v8::Value> arg = info[0];
if (!arg->IsFunction()) {
- throwTypeError("Callback argument must be a function", info.GetIsolate());
+ exceptionState.throwTypeError("Callback argument must be a function");
+ exceptionState.throwIfNeeded();
return;
}
« no previous file with comments | « Source/bindings/v8/custom/V8CryptoCustom.cpp ('k') | Source/bindings/v8/custom/V8SVGLengthCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698