Chromium Code Reviews| Index: Source/bindings/tests/results/V8TestObject.cpp |
| diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp |
| index 604ac1076004b94dd463a262023cd03223fd5fd6..84714932c35da4db5f152d28113672d315026cd0 100644 |
| --- a/Source/bindings/tests/results/V8TestObject.cpp |
| +++ b/Source/bindings/tests/results/V8TestObject.cpp |
| @@ -28,6 +28,7 @@ |
| #include "V8Document.h" |
| #include "V8Float32Array.h" |
| #include "V8Node.h" |
| +#include "V8NodeList.h" |
| #include "V8SVGDocument.h" |
| #include "V8SVGPoint.h" |
| #include "V8ScriptProfile.h" |
| @@ -4301,10 +4302,17 @@ v8::Handle<v8::Value> V8TestObject::indexedPropertyGetter(uint32_t index, const |
| { |
| ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
| TestObj* collection = toNative(info.Holder()); |
| - RefPtr<Node> element = collection->item(index); |
| - if (!element) |
| + WTF::UnionType2<NodeList, Node> element = collection->item(index); |
| + if (element.isNull()) |
| return v8Undefined(); |
| - return toV8Fast(element.release(), info, collection); |
| + |
| + v8::Handle<v8::Value> jsValue; |
| + if (element.isValue0Enabled()) |
| + jsValue = toV8Fast(element.getValue0(), info, collection); |
| + if (element.isValue1Enabled()) |
| + jsValue = toV8Fast(element.getValue1(), info, collection); |
| + |
| + return jsValue; |
|
haraken
2013/05/15 10:56:25
Can we write this like:
return toV8Fast(element
|
| } |
| v8::Handle<v8::Value> V8TestObject::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) |
| @@ -4320,7 +4328,10 @@ v8::Handle<v8::Value> V8TestObject::namedPropertyGetter(v8::Local<v8::String> na |
| String element = collection->namedItem(propertyName); |
| if (element.isNull()) |
| return v8Undefined(); |
| - return v8String(element, info.GetIsolate()); |
| + |
| + v8::Handle<v8::Value> jsValue; |
| + jsValue = v8String(element, info.GetIsolate()); |
| + return jsValue; |
|
haraken
2013/05/15 10:56:25
Nit: We might not want to introduce the jsValue in
|
| } |
| static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType) |