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

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

Issue 12440016: Temporary map ArrayBuffer/ArrayBufferView to dynamic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months 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
Index: tools/dom/scripts/generator.py
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 38e82da774e6815a6abf5214b475fdfec4aaa7d6..a53eaffe14ac12c39377a118876080b217ab89cb 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -391,6 +391,13 @@ class OperationInfo(object):
if self.constructor_name:
return rename_type(self.type_name) + '.' + self.constructor_name
else:
+ # TODO(antonm): temporary ugly hack.
+ # While in transition phase we allow both DOM's ArrayBuffer
+ # and dart:typeddata's ByteBuffer for IDLs' ArrayBuffers,
+ # hence ArrayBuffer is mapped to dynamic in arguments and return
+ # values. To compensate for that when generating ArrayBuffer itself,
+ # we need to lie a bit:
+ if self.type_name == 'ArrayBuffer': return 'ArrayBuffer'
return rename_type(self.type_name)
def ConstantOutputOrder(a, b):
@@ -1466,6 +1473,13 @@ _idl_type_registry = monitored.Dict('generator._idl_type_registry', {
'Uint8ClampedArray': TypedArrayTypeData('int'),
'Uint16Array': TypedArrayTypeData('int'),
'Uint32Array': TypedArrayTypeData('int'),
+ # TODO(antonm): temporary ugly hack.
+ # While in transition phase we allow both DOM's ArrayBuffer
+ # and dart:typeddata's ByteBuffer for IDLs' ArrayBuffers,
+ # hence ArrayBuffer is mapped to dynamic in arguments and return
+ # values.
+ 'ArrayBufferView': TypeData(clazz='Interface', dart_type='dynamic'),
+ 'ArrayBuffer': TypeData(clazz='Interface', dart_type='dynamic'),
'SVGAngle': TypeData(clazz='SVGTearOff'),
'SVGLength': TypeData(clazz='SVGTearOff'),
« sdk/lib/html/dart2js/html_dart2js.dart ('K') | « sdk/lib/web_audio/dartium/web_audio_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698