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

Side by Side Diff: Source/bindings/scripts/CodeGeneratorV8.pm

Issue 15834008: Auto-generate V8CSSStyleDeclaration::namedPropertyGetter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | Source/core/core.gypi » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 4712 matching lines...) Expand 10 before | Expand all | Expand 10 after
4723 my $types = $type->unionMemberTypes; 4723 my $types = $type->unionMemberTypes;
4724 my @codes = (); 4724 my @codes = ();
4725 for my $i (0 .. scalar(@$types)-1) { 4725 for my $i (0 .. scalar(@$types)-1) {
4726 my $unionMemberType = $types->[$i]; 4726 my $unionMemberType = $types->[$i];
4727 my $unionMemberNumber = $i + 1; 4727 my $unionMemberNumber = $i + 1;
4728 my $unionMemberVariable = $nativeValue . $i; 4728 my $unionMemberVariable = $nativeValue . $i;
4729 my $unionMemberEnabledVariable = $nativeValue . $i . "Enabled"; 4729 my $unionMemberEnabledVariable = $nativeValue . $i . "Enabled";
4730 my $unionMemberNativeValue = $unionMemberVariable; 4730 my $unionMemberNativeValue = $unionMemberVariable;
4731 $unionMemberNativeValue .= ".release()" if (IsRefPtrType($unionMembe rType)); 4731 $unionMemberNativeValue .= ".release()" if (IsRefPtrType($unionMembe rType));
4732 my $returnJSValueCode = NativeToJSValue($unionMemberType, $extendedA ttributes, $unionMemberNativeValue, $indent . " ", $receiver, $getCreationCon text, $getIsolate, $getHolderContainer, $getScriptWrappable, $returnHandleType, $forMainWorldSuffix); 4732 my $returnJSValueCode = NativeToJSValue($unionMemberType, $extendedA ttributes, $unionMemberNativeValue, $indent . " ", $receiver, $getCreationCon text, $getIsolate, $getHolderContainer, $getScriptWrappable, $returnHandleType, $forMainWorldSuffix);
4733 my $isNotNull = GenerateIsNullExpression($unionMemberType, $unionMem berVariable);
4734 $isNotNull = " && !" . $isNotNull if $isNotNull;
4735 my $code = ""; 4733 my $code = "";
kojih 2013/05/24 05:41:54 isNotNull check must not exist, because there is a
haraken 2013/05/24 06:03:05 Makes sense.
4736 $code .= "${indent}if (${unionMemberEnabledVariable}${isNotNull})\n" ; 4734 $code .= "${indent}if (${unionMemberEnabledVariable})\n";
4737 $code .= "${returnJSValueCode}"; 4735 $code .= "${returnJSValueCode}";
4738 push @codes, $code; 4736 push @codes, $code;
4739 } 4737 }
4740 return join "\n", @codes; 4738 return join "\n", @codes;
4741 } 4739 }
4742 4740
4743 return "$indent$receiver v8Boolean($nativeValue, $getIsolate);" if $type eq "boolean"; 4741 return "$indent$receiver v8Boolean($nativeValue, $getIsolate);" if $type eq "boolean";
4744 return "$indent$receiver v8Undefined();" if $type eq "void"; # equivalen t to v8Undefined() 4742 return "$indent$receiver v8Undefined();" if $type eq "void"; # equivalen t to v8Undefined()
4745 4743
4746 # HTML5 says that unsigned reflected attributes should be in the range 4744 # HTML5 says that unsigned reflected attributes should be in the range
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
5388 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 5386 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
5389 $found = 1; 5387 $found = 1;
5390 } 5388 }
5391 return 1 if $found; 5389 return 1 if $found;
5392 }, 0); 5390 }, 0);
5393 5391
5394 return $found; 5392 return $found;
5395 } 5393 }
5396 5394
5397 1; 5395 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | Source/core/core.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698