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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp

Issue 1476863003: bindings: Ignores the last undefined arguments when counting the args. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed a review comment. Created 5 years, 1 month 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: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
index 177943638b0c910bd5de697b3f9a61f7d094b282..e351b251a358f7341632d4ae4934ecce9b83aa40 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
@@ -289,7 +289,13 @@ static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(con
TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder());
bool optionalBooleanArgument;
{
- if (UNLIKELY(info.Length() <= 0)) {
+ int numArgsPassed = info.Length();
+ while (numArgsPassed > 0) {
+ if (!info[numArgsPassed - 1]->IsUndefined())
+ break;
+ --numArgsPassed;
+ }
+ if (UNLIKELY(numArgsPassed <= 0)) {
v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()), impl);
return;
}
@@ -313,7 +319,13 @@ static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForM
TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder());
bool optionalBooleanArgument;
{
- if (UNLIKELY(info.Length() <= 0)) {
+ int numArgsPassed = info.Length();
+ while (numArgsPassed > 0) {
+ if (!info[numArgsPassed - 1]->IsUndefined())
+ break;
+ --numArgsPassed;
+ }
+ if (UNLIKELY(numArgsPassed <= 0)) {
v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698