Chromium Code Reviews| Index: Source/bindings/scripts/code_generator_v8.pm |
| diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm |
| index df956b87dff421b022246172e6284f092390125e..772d26bbb9ae51c485fc42d42bbac2227451b084 100644 |
| --- a/Source/bindings/scripts/code_generator_v8.pm |
| +++ b/Source/bindings/scripts/code_generator_v8.pm |
| @@ -440,7 +440,11 @@ sub AddIncludesForType |
| } elsif (IsTypedArrayType($type)) { |
| AddToImplIncludes("bindings/v8/custom/V8${type}Custom.h"); |
| } elsif (my $arrayType = GetArrayType($type)) { |
| - AddIncludesForType($arrayType); |
| + if (IsDictionaryType($arrayType)) { |
|
Nils Barth (inactive)
2013/11/19 06:45:43
I think you can just add:
} elsif ($type eq "Dicti
alancutter (OOO until 2018)
2013/11/19 11:00:44
Done.
|
| + AddToImplIncludes("bindings/v8/Dictionary.h"); |
| + } else { |
| + AddIncludesForType($arrayType); |
| + } |
| } else { |
| AddToImplIncludes("V8${type}.h"); |
| } |
| @@ -5304,7 +5308,7 @@ sub GetNativeType |
| return "DOMTimeStamp" if $type eq "DOMTimeStamp"; |
| return "double" if $type eq "Date"; |
| return "ScriptValue" if $type eq "any" or IsCallbackFunctionType($type); |
| - return "Dictionary" if $type eq "Dictionary"; |
| + return "Dictionary" if IsDictionaryType($type); |
| die "UnionType is not supported" if IsUnionType($type); |
| @@ -5326,6 +5330,7 @@ sub GetNativeType |
| if ($arrayOrSequenceType) { |
| my $nativeType = GetNativeType($arrayOrSequenceType); |
| $nativeType .= " " if ($nativeType =~ />$/); |
| + return "DictionarySequence" if IsDictionaryType($nativeType); |
| return "Vector<${nativeType}>"; |
| } |
| @@ -5419,7 +5424,7 @@ sub JSValueToNative |
| return "SerializedScriptValue::create($value, $getIsolate)"; |
| } |
| - if ($type eq "Dictionary") { |
| + if (IsDictionaryType($type)) { |
| AddToImplIncludes("bindings/v8/Dictionary.h"); |
| return "Dictionary($value, $getIsolate)"; |
| } |
| @@ -5459,6 +5464,9 @@ sub JSValueToNative |
| my $arrayOrSequenceType = GetArrayOrSequenceType($type); |
| if ($arrayOrSequenceType) { |
| + if (IsDictionaryType($arrayOrSequenceType)) { |
| + return "toDictionarySequence($value, $argIndexOrZero, $getIsolate)"; |
| + } |
| if (IsRefPtrType($arrayOrSequenceType)) { |
| AddToImplIncludes("V8${arrayOrSequenceType}.h"); |
| return "(toRefPtrNativeArray<${arrayOrSequenceType}, V8${arrayOrSequenceType}>($value, $argIndexOrZero, $getIsolate))"; |
| @@ -5943,6 +5951,13 @@ sub IsEnumType |
| return 0; |
| } |
| +sub IsDictionaryType |
|
Nils Barth (inactive)
2013/11/19 06:45:43
This subroutine doesn't add anything, and is less
alancutter (OOO until 2018)
2013/11/19 11:00:44
Done.
|
| +{ |
| + my $type = shift; |
| + |
| + return $type eq "Dictionary"; |
| +} |
| + |
| sub ValidEnumValues |
| { |
| my $type = shift; |