Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
index a033833252b4dfca4279fc4a9c1e3026f9eb8484..7b21b26c0a60f3a4129280d762cd403961032fef 100644 |
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
@@ -2553,9 +2553,14 @@ static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo |
{ |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
+ // We assume that all the implementations support length() method, although |
+ // the spec doesn't require that length() must exist. It's okay that |
+ // the interface does not have length attribute as long as the |
+ // implementation supports length() member function. |
+ if (index >= impl->length()) |
+ return; // Returns undefined due to out-of-range. |
+ |
String result = impl->anonymousIndexedGetter(index); |
- if (result.isNull()) |
- return; |
v8SetReturnValueString(info, result, info.GetIsolate()); |
} |