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

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

Issue 12929005: dart:typeddata for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert status change 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 c84c6e697dbf01624f8b0b550b3a5ef53002bdd1..32281be2b7b04ca7c350ae01ef13447fb2eaa9e5 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -79,15 +79,15 @@ _dart_attribute_renames = monitored.Dict('generator._dart_attribute_renames', {
# factory provider.
#
interface_factories = monitored.Dict('generator.interface_factories', {
- 'Float32Array': '_TypedArrayFactoryProvider',
- 'Float64Array': '_TypedArrayFactoryProvider',
- 'Int8Array': '_TypedArrayFactoryProvider',
- 'Int16Array': '_TypedArrayFactoryProvider',
- 'Int32Array': '_TypedArrayFactoryProvider',
- 'Uint8Array': '_TypedArrayFactoryProvider',
- 'Uint8ClampedArray': '_TypedArrayFactoryProvider',
- 'Uint16Array': '_TypedArrayFactoryProvider',
- 'Uint32Array': '_TypedArrayFactoryProvider',
+ 'Float32List': '_TypedArrayFactoryProvider',
Anton Muhin 2013/03/19 12:31:24 do we still need those?
+ 'Float64List': '_TypedArrayFactoryProvider',
+ 'Int8List': '_TypedArrayFactoryProvider',
+ 'Int16List': '_TypedArrayFactoryProvider',
+ 'Int32List': '_TypedArrayFactoryProvider',
+ 'Uint8List': '_TypedArrayFactoryProvider',
+ 'Uint8ClampedList': '_TypedArrayFactoryProvider',
+ 'Uint16List': '_TypedArrayFactoryProvider',
+ 'Uint32List': '_TypedArrayFactoryProvider',
})
#
@@ -397,7 +397,7 @@ class OperationInfo(object):
# 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'
+ if self.type_name == 'ArrayBuffer': return 'ByteBuffer'
return rename_type(self.type_name)
def ConstantOutputOrder(a, b):
@@ -554,13 +554,13 @@ def FindConversion(idl_type, direction, interface, member):
dart2js_annotations = monitored.Dict('generator.dart2js_annotations', {
'ArrayBuffer': [
- "@Creates('ArrayBuffer')",
- "@Returns('ArrayBuffer|Null')",
+ "@Creates('ByteBuffer')",
+ "@Returns('ByteBuffer|Null')",
],
'ArrayBufferView': [
- "@Creates('ArrayBufferView')",
- "@Returns('ArrayBufferView|Null')",
+ "@Creates('TypedData')",
+ "@Returns('TypedData|Null')",
],
'CanvasRenderingContext2D.createImageData': [
@@ -621,7 +621,7 @@ dart2js_annotations = monitored.Dict('generator.dart2js_annotations', {
"@Returns('Element|Document')",
],
- 'FileReader.result': ["@Creates('String|ArrayBuffer|Null')"],
+ 'FileReader.result': ["@Creates('String|ByteBuffer|Null')"],
# Rather than have the result of an IDBRequest as a union over all possible
# results, we mark the result as instantiating any classes, and mark
@@ -690,14 +690,14 @@ dart2js_annotations = monitored.Dict('generator.dart2js_annotations', {
'WebGLRenderingContext.getParameter': [
# Taken from http://www.khronos.org/registry/webgl/specs/latest/
# Section 5.14.3 Setting and getting state
- "@Creates('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array"
+ "@Creates('Null|num|String|bool|=List|Float32List|Int32List|Uint32List"
"|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')",
- "@Returns('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array"
+ "@Returns('Null|num|String|bool|=List|Float32List|Int32List|Uint32List"
"|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')",
],
'XMLHttpRequest.response': [
- "@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')",
+ "@Creates('ByteBuffer|Blob|Document|=Object|=List|String|num')",
],
})

Powered by Google App Engine
This is Rietveld 408576698