Changeset 113686 in webkit
- Timestamp:
- Apr 9, 2012 10:51:40 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113685 r113686 1 2012-04-09 Lu Guanqun <guanqun.lu@intel.com> 2 3 combine two arrays in EventException.cpp into one 4 https://bugs.webkit.org/show_bug.cgi?id=83451 5 6 Reviewed by Kentaro Hara. 7 8 No new tests required. 9 10 * dom/EventException.cpp: 11 (EventExceptionNameDescription): 12 (WebCore): 13 (WebCore::EventException::initializeDescription): 14 1 15 2012-04-09 Lu Guanqun <guanqun.lu@intel.com> 2 16 -
trunk/Source/WebCore/dom/EventException.cpp
r98686 r113686 32 32 namespace WebCore { 33 33 34 // FIXME: This should be an array of structs to pair the names and descriptions. 35 static const char* const eventExceptionNames[] = { 36 "UNSPECIFIED_EVENT_TYPE_ERR", 37 "DISPATCH_REQUEST_ERR" 34 static struct EventExceptionNameDescription { 35 const char* const name; 36 const char* const description; 37 } exceptions[] = { 38 { "UNSPECIFIED_EVENT_TYPE_ERR", "The Event's type was not specified by initializing the event before the method was called." }, 39 { "DISPATCH_REQUEST_ERR", "The Event object is already being dispatched." } 38 40 }; 39 40 static const char* const eventExceptionDescriptions[] = {41 "The Event's type was not specified by initializing the event before the method was called.",42 "The Event object is already being dispatched."43 };44 45 COMPILE_ASSERT(WTF_ARRAY_LENGTH(eventExceptionNames) == WTF_ARRAY_LENGTH(eventExceptionDescriptions), EventExceptionTablesMustMatch);46 41 47 42 bool EventException::initializeDescription(ExceptionCode ec, ExceptionCodeDescription* description) … … 54 49 description->type = EventExceptionType; 55 50 56 size_t tableSize = WTF_ARRAY_LENGTH(e ventExceptionNames);51 size_t tableSize = WTF_ARRAY_LENGTH(exceptions); 57 52 size_t tableIndex = ec - UNSPECIFIED_EVENT_TYPE_ERR; 58 53 59 description->name = tableIndex < tableSize ? e ventExceptionNames[tableIndex]: 0;60 description->description = tableIndex < tableSize ? e ventExceptionDescriptions[tableIndex]: 0;54 description->name = tableIndex < tableSize ? exceptions[tableIndex].name : 0; 55 description->description = tableIndex < tableSize ? exceptions[tableIndex].description : 0; 61 56 62 57 return true;
Note: See TracChangeset
for help on using the changeset viewer.