Chromium Code Reviews| Index: Source/bindings/scripts/CodeGeneratorV8.pm |
| diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm |
| index 9972dafcbaf43964df84aa05a003024cb324896e..be50b780b99acc28b749e8b0502cd27ebbd85143 100644 |
| --- a/Source/bindings/scripts/CodeGeneratorV8.pm |
| +++ b/Source/bindings/scripts/CodeGeneratorV8.pm |
| @@ -3193,7 +3193,6 @@ sub GenerateImplementationIndexedPropertyAccessors |
| my $indexedEnumeratorFunction = $indexedGetterFunction; |
| $indexedEnumeratorFunction = 0 if $indexedGetterFunction && $indexedGetterFunction->extendedAttributes->{"NotEnumerable"}; |
| - # FIXME: Support generated named query bindings. |
| my $indexedQueryFunction = 0; |
| # If there is an enumerator, there MUST be a query method to properly communicate property attributes. |
| my $hasQuery = $indexedQueryFunction || $indexedEnumeratorFunction; |
| @@ -3351,10 +3350,12 @@ sub GenerateImplementationNamedPropertyAccessors |
| GenerateImplementationNamedPropertyEnumerator($interface); |
| } |
| - # FIXME: Support generated named query bindings. |
| - my $namedQueryFunction = 0; |
| # If there is an enumerator, there MUST be a query method to properly communicate property attributes. |
| - my $hasQuery = $namedQueryFunction || $namedEnumeratorFunction; |
| + my $hasQuery = $namedEnumeratorFunction; |
| + my $hasCustomNamedQuery = $hasCustomNamedEnumerator; |
| + if ($hasQuery && !$hasCustomNamedQuery) { |
| + GenerateImplementationNamedPropertyQuery($interface); |
| + } |
| my $subCode = ""; |
| if ($namedGetterFunction || $namedSetterFunction || $namedDeleterFunction || $namedEnumeratorFunction || $hasQuery) { |
| @@ -3643,6 +3644,32 @@ void ${v8ClassName}::namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8:: |
| END |
| } |
| +sub GenerateImplementationNamedPropertyQuery |
| +{ |
| + my $interface = shift; |
| + my $implClassName = GetImplName($interface); |
| + my $v8ClassName = GetV8ClassName($interface); |
| + |
| + $implementation{nameSpaceWebCore}->add(<<END); |
| +void ${v8ClassName}::namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
| +{ |
| + ${implClassName}* collection = toNative(info.Holder()); |
| + AtomicString propertyName = toWebCoreAtomicString(name); |
| + ExceptionCode ec = 0; |
| + int returnValue = 0; |
| + bool result = collection->namedPropertyQuery(propertyName, returnValue, ec); |
| + if (ec) { |
| + setDOMException(ec, info.GetIsolate()); |
| + return; |
| + } |
| + if (!result) |
| + return; |
| + v8SetReturnValueInt(info, 0); |
|
haraken
2013/06/17 07:41:02
0 => returnValue.
However, I might want to remove
kojih
2013/06/17 07:52:57
OK.
|
| +} |
| + |
| +END |
| +} |
| + |
| sub GenerateImplementationLegacyCall |
| { |
| my $interface = shift; |