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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.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: Updated layout tests. 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/V8TestInterfaceNamedConstructor.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
index 582902cfb8355e3ab59a0a2b635fdd2c7a31b131..89d27bdeb25385dd1110e03550b97de27d82fac2 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
@@ -125,6 +125,12 @@ static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio
V8StringResource<> defaultNullStringOptionalstringArg;
V8StringResource<> optionalStringArg;
{
+ int numArgsPassed = info.Length();
+ while (numArgsPassed > 0) {
+ if (!info[numArgsPassed - 1]->IsUndefined())
+ break;
+ --numArgsPassed;
+ }
stringArg = info[0];
if (!stringArg.prepare())
return;
@@ -144,7 +150,7 @@ static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio
} else {
defaultNullStringOptionalstringArg = nullptr;
}
- if (UNLIKELY(info.Length() <= 5)) {
+ if (UNLIKELY(numArgsPassed <= 5)) {
Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg, exceptionState);
if (exceptionState.hadException()) {

Powered by Google App Engine
This is Rietveld 408576698