Index: Source/core/scripts/make_dom_exceptions.py |
diff --git a/Source/core/scripts/make_dom_exceptions.py b/Source/core/scripts/make_dom_exceptions.py |
index d2bb77d5bd1f1903a872c732d2b4a05296d19ba9..ef1d07854ed1899ef3f8e84bbf2761e1391920ea 100755 |
--- a/Source/core/scripts/make_dom_exceptions.py |
+++ b/Source/core/scripts/make_dom_exceptions.py |
@@ -115,8 +115,7 @@ ExceptionCodeDescription::ExceptionCodeDescription(ExceptionCode ec) |
class ExceptionCodeDescriptionWriter(name_macros.Writer): |
defaults = { |
- 'JSInterfaceName': None, |
- 'interfaceName': None, |
+ 'implementedAs': None, |
'conditional': None, |
} |
default_parameters = { |
@@ -131,9 +130,13 @@ class ExceptionCodeDescriptionWriter(name_macros.Writer): |
def _exceptions(self): |
return self.in_file.name_dictionaries |
+ def _exception_class_name(self, exception): |
haraken
2013/06/17 13:38:37
Can't you use _class_name_for_entry in name_macros
|
+ if exception['implementedAs']: |
+ return exception['implementedAs'] |
+ return os.path.basename(exception['name']) |
+ |
def _exception_type(self, exception): |
- name = os.path.basename(exception['name']) |
- return self.wrap_with_condition(' ' + name + 'Type,', exception['conditional']) |
+ return self.wrap_with_condition(' ' + self._exception_class_name(exception) + 'Type,', exception['conditional']) |
def generate_header(self): |
return HEADER_TEMPLATE % { |
@@ -143,13 +146,13 @@ class ExceptionCodeDescriptionWriter(name_macros.Writer): |
} |
def _include(self, exception): |
- include = '#include "' + exception['name'] + '.h"' |
+ include = '#include "' + self._headers_header_include_path(exception) + '"' |
return self.wrap_with_condition(include, exception['conditional']) |
def _description_initalization(self, exception): |
name = os.path.basename(exception['name']) |
- if name == 'DOMCoreException': |
- return '' # DOMCoreException needs to be last because it's a catch-all. |
+ if name == 'DOMException': |
+ return '' # DOMException needs to be last because it's a catch-all. |
description_initalization = """ if (%(name)s::initializeDescription(ec, this)) |
return;""" % {'name': name} |
return self.wrap_with_condition(description_initalization, exception['conditional']) |