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

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

Issue 9453030: Fix for issue 1814 for dart:dom (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo Created 8 years, 10 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
« no previous file with comments | « client/dom/generated/src/frog/Uint8Array.dart ('k') | client/dom/scripts/systemfrog.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/generator.py
diff --git a/client/dom/scripts/generator.py b/client/dom/scripts/generator.py
index 32fcbb61733bc0b553ea0439e7244533f69fdaaa..6239fc89f8c8e422717e99b494aa12ab378cb571 100644
--- a/client/dom/scripts/generator.py
+++ b/client/dom/scripts/generator.py
@@ -137,6 +137,36 @@ _alternate_methods = {
('WheelEvent', 'initWheelEvent'): ['initWebKitWheelEvent', 'initWheelEvent']
}
+#
+# Custom native bodies for frog implementations of dom operations that appear in
+# dart:dom and dart:html. This is used to work-around the lack of a 'rename'
+# feature in the 'native' string - the correct name is available on the DartName
+# extended attribute. See Issue 1814
+#
+_dom_frog_native_typed_array_set_operation = """
+if (offset == null) return this.set(array);
+return this.set(array, offset);"""
+
+dom_frog_native_bodies = {
+ 'IDBCursor.continueFunction':
+ """
+if (key == null) return this['continue']();
+return this['continue'](key);
+""",
+ 'IDBIndex.getObject': """return this.get(key);""",
+ 'IDBObjectStore.getObject': """return this.get(key);""",
+ 'Float32Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Float64Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Int16Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Int32Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Int8Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Uint16Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Uint32Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Uint8Array.setElements': _dom_frog_native_typed_array_set_operation,
+ 'Uint8ClampedArray.setElements': _dom_frog_native_typed_array_set_operation,
+}
+
+
def ConvertPrimitiveType(type_name):
if type_name.startswith('unsigned '):
type_name = type_name[len('unsigned '):]
« no previous file with comments | « client/dom/generated/src/frog/Uint8Array.dart ('k') | client/dom/scripts/systemfrog.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698