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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceNode.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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
Index: Source/bindings/tests/results/V8TestInterfaceNode.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceNode.cpp b/Source/bindings/tests/results/V8TestInterfaceNode.cpp
index ab822a9628064da9ea73b63050faadbac65cf01d..6fc9f24d7713420760fb3ab35aa2c9c66244771a 100644
--- a/Source/bindings/tests/results/V8TestInterfaceNode.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceNode.cpp
@@ -8,6 +8,7 @@
#include "V8TestInterfaceNode.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/Optional.h"
#include "bindings/core/v8/V8AbstractEventListener.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8EventListenerList.h"
@@ -249,17 +250,18 @@ static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c
static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
- bool optionalBooleanArgument;
+ bool optionalBooleanArgument = false;
+ bool optionalBooleanArgumentMissing = false;
{
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
- if (UNLIKELY(info.Length() <= 0)) {
- v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()), impl);
- return;
+ if (!info[0]->IsUndefined()) {
+ TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue());
+ } else {
+ optionalBooleanArgumentMissing = true;
}
- TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue());
}
- v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg(optionalBooleanArgument)), impl);
+ v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg(Optional<bool>(optionalBooleanArgument, optionalBooleanArgumentMissing))), impl);
}
static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -272,17 +274,18 @@ static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
- bool optionalBooleanArgument;
+ bool optionalBooleanArgument = false;
+ bool optionalBooleanArgumentMissing = false;
{
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
- if (UNLIKELY(info.Length() <= 0)) {
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()));
- return;
+ if (!info[0]->IsUndefined()) {
+ TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue());
+ } else {
+ optionalBooleanArgumentMissing = true;
}
- TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue());
}
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg(optionalBooleanArgument)));
+ v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg(Optional<bool>(optionalBooleanArgument, optionalBooleanArgumentMissing))));
}
static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698