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

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

Issue 100473006: IDL compiler: [Constructor] w/o arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced to changes Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_interface.py » ('j') | no next file with comments »
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 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; 2764 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n";
2765 } 2765 }
2766 2766
2767 # FIXME: Currently [Constructor(...)] does not yet support optional argument s without [Default=...] 2767 # FIXME: Currently [Constructor(...)] does not yet support optional argument s without [Default=...]
2768 my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersC heck($function, $interface, ""); 2768 my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersC heck($function, $interface, "");
2769 $code .= $parameterCheckString; 2769 $code .= $parameterCheckString;
2770 2770
2771 if ($interface->extendedAttributes->{"ConstructorCallWith"}) { 2771 if ($interface->extendedAttributes->{"ConstructorCallWith"}) {
2772 if ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Executio nContext") { 2772 if ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Executio nContext") {
2773 push(@beforeArgumentList, "context"); 2773 push(@beforeArgumentList, "context");
2774 $code .= "\n"; 2774 $code .= " ExecutionContext* context = getExecutionContext();\n";
2775 $code .= " ExecutionContext* context = getExecutionContext();";
2776 } elsif ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Doc ument") { 2775 } elsif ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Doc ument") {
2777 push(@beforeArgumentList, "document"); 2776 push(@beforeArgumentList, "document");
2778 $code .= "\n"; 2777 $code .= " Document& document = *toDocument(getExecutionContext() );\n";
2779 $code .= " Document& document = *toDocument(getExecutionContext() );";
2780 } 2778 }
2781 } 2779 }
2782 2780
2783 if ($constructorRaisesException) { 2781 if ($constructorRaisesException) {
2784 push(@afterArgumentList, "exceptionState"); 2782 push(@afterArgumentList, "exceptionState");
2785 } 2783 }
2786 2784
2787 my @argumentList; 2785 my @argumentList;
2788 my $index = 0; 2786 my $index = 0;
2789 foreach my $parameter (@{$function->parameters}) { 2787 foreach my $parameter (@{$function->parameters}) {
2790 last if $index eq $paramIndex; 2788 last if $index eq $paramIndex;
2791 if ($replacements{$parameter->name}) { 2789 if ($replacements{$parameter->name}) {
2792 push(@argumentList, $replacements{$parameter->name}); 2790 push(@argumentList, $replacements{$parameter->name});
2793 } else { 2791 } else {
2794 push(@argumentList, $parameter->name); 2792 push(@argumentList, $parameter->name);
2795 } 2793 }
2796 $index++; 2794 $index++;
2797 } 2795 }
2798 2796
2799 my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterAr gumentList); 2797 my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterAr gumentList);
2800 $code .= "\n";
2801 $code .= " RefPtr<${implClassName}> impl = ${implClassName}::create(${arg umentString});\n"; 2798 $code .= " RefPtr<${implClassName}> impl = ${implClassName}::create(${arg umentString});\n";
2802 $code .= " v8::Handle<v8::Object> wrapper = info.Holder();\n"; 2799 $code .= " v8::Handle<v8::Object> wrapper = info.Holder();\n";
2803 2800
2804 if ($constructorRaisesException) { 2801 if ($constructorRaisesException) {
2805 $code .= " if (exceptionState.throwIfNeeded())\n"; 2802 $code .= " if (exceptionState.throwIfNeeded())\n";
2806 $code .= " return;\n"; 2803 $code .= " return;\n";
2807 } 2804 }
2808 2805
2809 $code .= <<END; 2806 $code .= <<END;
2810 2807
(...skipping 3613 matching lines...) Expand 10 before | Expand all | Expand 10 after
6424 6421
6425 return 1 if $interface->extendedAttributes->{"CustomToV8"}; 6422 return 1 if $interface->extendedAttributes->{"CustomToV8"};
6426 return 1 if $interface->extendedAttributes->{"CustomWrap"}; 6423 return 1 if $interface->extendedAttributes->{"CustomWrap"};
6427 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6424 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6428 return 1 if InheritsInterface($interface, "Document"); 6425 return 1 if InheritsInterface($interface, "Document");
6429 6426
6430 return 0; 6427 return 0;
6431 } 6428 }
6432 6429
6433 1; 6430 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698