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

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: 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
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 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; 2769 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n";
2770 } 2770 }
2771 2771
2772 # FIXME: Currently [Constructor(...)] does not yet support optional argument s without [Default=...] 2772 # FIXME: Currently [Constructor(...)] does not yet support optional argument s without [Default=...]
2773 my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersC heck($function, $interface, ""); 2773 my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersC heck($function, $interface, "");
2774 $code .= $parameterCheckString; 2774 $code .= $parameterCheckString;
2775 2775
2776 if ($interface->extendedAttributes->{"ConstructorCallWith"}) { 2776 if ($interface->extendedAttributes->{"ConstructorCallWith"}) {
2777 if ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Executio nContext") { 2777 if ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Executio nContext") {
2778 push(@beforeArgumentList, "context"); 2778 push(@beforeArgumentList, "context");
2779 $code .= "\n"; 2779 $code .= " ExecutionContext* context = getExecutionContext();\n";
2780 $code .= " ExecutionContext* context = getExecutionContext();";
2781 } elsif ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Doc ument") { 2780 } elsif ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Doc ument") {
2782 push(@beforeArgumentList, "document"); 2781 push(@beforeArgumentList, "document");
2783 $code .= "\n"; 2782 $code .= " Document& document = *toDocument(getExecutionContext() );\n";
2784 $code .= " Document& document = *toDocument(getExecutionContext() );";
2785 } 2783 }
2786 } 2784 }
2787 2785
2788 if ($constructorRaisesException) { 2786 if ($constructorRaisesException) {
2789 push(@afterArgumentList, "exceptionState"); 2787 push(@afterArgumentList, "exceptionState");
2790 } 2788 }
2791 2789
2792 my @argumentList; 2790 my @argumentList;
2793 my $index = 0; 2791 my $index = 0;
2794 foreach my $parameter (@{$function->parameters}) { 2792 foreach my $parameter (@{$function->parameters}) {
2795 last if $index eq $paramIndex; 2793 last if $index eq $paramIndex;
2796 if ($replacements{$parameter->name}) { 2794 if ($replacements{$parameter->name}) {
2797 push(@argumentList, $replacements{$parameter->name}); 2795 push(@argumentList, $replacements{$parameter->name});
2798 } else { 2796 } else {
2799 push(@argumentList, $parameter->name); 2797 push(@argumentList, $parameter->name);
2800 } 2798 }
2801 $index++; 2799 $index++;
2802 } 2800 }
2803 2801
2804 my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterAr gumentList); 2802 my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterAr gumentList);
2805 $code .= "\n";
2806 $code .= " RefPtr<${implClassName}> impl = ${implClassName}::create(${arg umentString});\n"; 2803 $code .= " RefPtr<${implClassName}> impl = ${implClassName}::create(${arg umentString});\n";
2807 $code .= " v8::Handle<v8::Object> wrapper = info.Holder();\n"; 2804 $code .= " v8::Handle<v8::Object> wrapper = info.Holder();\n";
2808 2805
2809 if ($constructorRaisesException) { 2806 if ($constructorRaisesException) {
2810 $code .= " if (exceptionState.throwIfNeeded())\n"; 2807 $code .= " if (exceptionState.throwIfNeeded())\n";
2811 $code .= " return;\n"; 2808 $code .= " return;\n";
2812 } 2809 }
2813 2810
2814 $code .= <<END; 2811 $code .= <<END;
2815 2812
(...skipping 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after
6452 return 1 if $name eq "ErrorCallback"; 6449 return 1 if $name eq "ErrorCallback";
6453 return 1 if $name eq "FileCallback"; 6450 return 1 if $name eq "FileCallback";
6454 return 1 if $name eq "FileSystemCallback"; 6451 return 1 if $name eq "FileSystemCallback";
6455 return 1 if $name eq "FileSystemVoidCallback"; 6452 return 1 if $name eq "FileSystemVoidCallback";
6456 return 1 if $name eq "FileWriterCallback"; 6453 return 1 if $name eq "FileWriterCallback";
6457 return 1 if $name eq "MetadataCallback"; 6454 return 1 if $name eq "MetadataCallback";
6458 return 0; 6455 return 0;
6459 } 6456 }
6460 6457
6461 1; 6458 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_interface.py » ('j') | Source/bindings/scripts/unstable/v8_interface.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698