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

Unified Diff: client/dom/scripts/dartgenerator.py

Issue 9264057: Refresh dart:dom libraries from WebKit (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't re-implement List<>, causes code that dartc rejects due to static 'override' Created 8 years, 11 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: client/dom/scripts/dartgenerator.py
diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py
index 0a8184d4cacfab2ba85606a4f436a565665394fd..cfb04a53dcf831834b3f268629b065b5d13403f5 100755
--- a/client/dom/scripts/dartgenerator.py
+++ b/client/dom/scripts/dartgenerator.py
@@ -44,7 +44,7 @@ _idl_to_dart_type_conversions = {
'sequence': 'List',
# TODO(vsm): We need to support other types. We could weaken to
# Object, or inject SSV into the appropriate types.
- 'SerializedScriptValue': 'String',
+ 'SerializedScriptValue': 'Dynamic/*SerializedScriptValue*/',
vsm 2012/01/31 02:41:40 Not sure it's useful to put this in the comment if
# TODO(vsm): Automatically recognize types defined in src.
'TimeoutHandler': 'TimeoutHandler',
'RequestAnimationFrameCallback': 'RequestAnimationFrameCallback',
@@ -95,6 +95,7 @@ _interface_factories = {
'Uint8Array': '_TypedArrayFactoryProvider',
'Uint16Array': '_TypedArrayFactoryProvider',
'Uint32Array': '_TypedArrayFactoryProvider',
+ 'Uint8ClampedArray': '_TypedArrayFactoryProvider',
}
#
@@ -750,6 +751,9 @@ def MaybeTypedArrayElementType(interface):
for parent in interface.parents:
if parent.type.id == 'ArrayBufferView':
return MaybeListElementType(interface)
+ if parent.type.id == 'Uint8Array':
+ return 'int'
+ #return MaybeListElementType(interface)
vsm 2012/01/31 02:41:40 Delete comment.
return None
@@ -2010,13 +2014,13 @@ class FrogInterfaceGenerator(object):
def AddTypedArrayConstructors(self, element_type):
self._members_emitter.Emit(
'\n'
- ' factory $CTOR(int length) => _construct(length);\n'
+ ' factory $CTOR(int length) => _construct_$CTOR(length);\n'
'\n'
- ' factory $CTOR.fromList(List<$TYPE> list) => _construct(list);\n'
+ ' factory $CTOR.fromList(List<$TYPE> list) => _construct_$CTOR(list);\n'
'\n'
- ' factory $CTOR.fromBuffer(ArrayBuffer buffer) => _construct(buffer);\n'
+ ' factory $CTOR.fromBuffer(ArrayBuffer buffer) => _construct_$CTOR(buffer);\n'
'\n'
- ' static _construct(arg) native \'return new $CTOR(arg);\';\n',
+ ' static _construct_$CTOR(arg) native \'return new $CTOR(arg);\';\n',
CTOR=self._interface.id,
TYPE=element_type)

Powered by Google App Engine
This is Rietveld 408576698