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

Side by Side Diff: Source/bindings/v8/Dictionary.cpp

Issue 99333017: IDL compiler: simplify type conversion in Event Constructor (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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 void Dictionary::ConversionContext::resetPerPropertyContext() 740 void Dictionary::ConversionContext::resetPerPropertyContext()
741 { 741 {
742 if (m_dirty) { 742 if (m_dirty) {
743 m_dirty = false; 743 m_dirty = false;
744 m_isNullable = false; 744 m_isNullable = false;
745 m_propertyTypeName = ""; 745 m_propertyTypeName = "";
746 m_numberConversion = NormalConversion; 746 m_numberConversion = NormalConversion;
747 } 747 }
748 } 748 }
749 749
750 Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(boo l isNullable, IntegerConversionConfiguration conversion, const String& typeName) 750 Dictionary::ConversionContext& Dictionary::ConversionContext::conversionType(boo l isNullable, IntegerConversionConfiguration conversion, const String& typeName)
751 { 751 {
752 ASSERT(!m_dirty); 752 ASSERT(!m_dirty);
753 m_dirty = true; 753 m_dirty = true;
754 m_isNullable = isNullable; 754 m_isNullable = isNullable;
755 m_propertyTypeName = typeName; 755 m_propertyTypeName = typeName;
756 m_numberConversion = conversion; 756 m_numberConversion = conversion;
757 757
758 return *this; 758 return *this;
759 } 759 }
760 760
761 Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(boo l isNullable, const String& typeName)
762 {
763 return withAttributes(isNullable, NormalConversion, typeName);
764 }
765
766 Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(boo l isNullable, IntegerConversionConfiguration conversion)
767 {
768 return withAttributes(isNullable, conversion, "");
769 }
770
771 Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(con st String& typeName)
772 {
773 return withAttributes(false, NormalConversion, typeName);
774 }
775
776 Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(boo l isNullable)
777 {
778 return withAttributes(isNullable, NormalConversion, "");
779 }
780
781 void Dictionary::ConversionContext::throwTypeError(const String& detail) 761 void Dictionary::ConversionContext::throwTypeError(const String& detail)
782 { 762 {
783 if (forConstructor()) { 763 if (forConstructor()) {
784 exceptionState().throwTypeError(detail); 764 exceptionState().throwTypeError(detail);
785 } else { 765 } else {
786 ASSERT(!methodName().isEmpty()); 766 ASSERT(!methodName().isEmpty());
787 exceptionState().throwTypeError(ExceptionMessages::failedToExecute(inter faceName(), methodName(), detail)); 767 exceptionState().throwTypeError(ExceptionMessages::failedToExecute(inter faceName(), methodName(), detail));
788 } 768 }
789 } 769 }
790 770
791 } // namespace WebCore 771 } // namespace WebCore
OLDNEW
« Source/bindings/v8/Dictionary.h ('K') | « Source/bindings/v8/Dictionary.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698