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

Unified Diff: tools/dom/scripts/systemnative.py

Issue 711003002: Add some ArgumentError and RangeError constructors that capture more information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« sdk/lib/core/errors.dart ('K') | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/systemnative.py
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index 432d68d642f6e05825b81beaafcdf785732b87d2..4f5a7ed9f66bdcbf0eced4f47fa8b0ad4f39bc78 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -364,7 +364,7 @@ def EncodeType(t):
class DartiumBackend(HtmlDartGenerator):
"""Generates Dart implementation for one DOM IDL interface."""
- def __init__(self, interface,
+ def __init__(self, interface,
cpp_library_emitter, options):
super(DartiumBackend, self).__init__(interface, options, True)
@@ -672,7 +672,7 @@ class DartiumBackend(HtmlDartGenerator):
constructor_callback_cpp_name = 'constructorCallback'
self._EmitConstructorInfrastructure(
- constructor_info, "", constructor_callback_cpp_name, '_create',
+ constructor_info, "", constructor_callback_cpp_name, '_create',
is_custom=True)
self._cpp_declarations_emitter.Emit(
@@ -686,10 +686,10 @@ class DartiumBackend(HtmlDartGenerator):
return IsOptional(argument)
def EmitStaticFactoryOverload(self, constructor_info, name, arguments):
- constructor_callback_cpp_name = name + 'constructorCallback'
+ constructor_callback_cpp_name = name + 'constructorCallback'
self._EmitConstructorInfrastructure(
- constructor_info, name, 'constructorCallback', name, arguments,
- emit_to_native=True,
+ constructor_info, name, 'constructorCallback', name, arguments,
+ emit_to_native=True,
is_custom=False)
ext_attrs = self._interface.ext_attrs
@@ -1048,7 +1048,7 @@ class DartiumBackend(HtmlDartGenerator):
'\n'
' $TYPE operator[](int index) {\n'
' if (index < 0 || index >= length)\n'
- ' throw new RangeError.range(index, 0, length);\n'
+ ' throw new RangeError.index(index, this);\n'
' return $(DART_NATIVE_NAME)(this, index);\n'
' }\n\n'
' $TYPE _nativeIndexedGetter(int index) =>'
@@ -1106,7 +1106,7 @@ class DartiumBackend(HtmlDartGenerator):
'\n'
' $TYPE operator[](int index) {\n'
' if (index < 0 || index >= length)\n'
- ' throw new RangeError.range(index, 0, length);\n'
+ ' throw new RangeError.index(index, this);\n'
' return $INDEXED_GETTER(index);\n'
' }\n',
TYPE=dart_element_type,
@@ -1120,7 +1120,7 @@ class DartiumBackend(HtmlDartGenerator):
formals = ', '.join(['int index', '%s value' % element_type])
parameters = ['index', 'value']
dart_declaration = 'void operator[]=(%s)' % formals
- self._GenerateNativeBinding('numericIndexSetter', 3,
+ self._GenerateNativeBinding('numericIndexSetter', 3,
dart_declaration, False, return_type, parameters,
'Callback', True, False)
« sdk/lib/core/errors.dart ('K') | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698