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

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

Issue 12543021: Allow more objects to be treated as ArrayBuffer and ArrayBufferView. (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/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 2f13d48413ebdeb932b5feeb23da072e6ce06d18..4ad06276d7be37791ab6f21fa423e55ac2bc79f5 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -231,6 +231,22 @@ class HtmlDartGenerator(object):
argument = signatures[signature_index][i]
parameter_name = parameter_names[i]
test_type = self._DartType(argument.type.id)
+ # TODO(antonm): temporary ugly hack.
Mads Ager (google) 2013/03/11 14:13:18 Let's expand on the comment? Temporary ugly hack
Anton Muhin 2013/03/11 14:35:27 Done.
+ from systemnative import DartiumBackend
+ if isinstance(self, DartiumBackend):
+ if argument.type.id == 'ArrayBufferView':
+ checks.append(
+ '(%(name)s is ArrayBufferView '
+ '|| %(name)s is _typeddata.TypedData '
+ '|| %(name)s == null)' % {'name': parameter_name})
+ continue
+ if argument.type.id == 'ArrayBuffer':
+ checks.append(
+ '(%(name)s is ArrayBuffer '
+ '|| %(name)s is _typeddata.ByteBuffer '
+ '|| %(name)s == null)' % {'name': parameter_name})
+ continue
+ # end of ugly hack.
if test_type in ['dynamic', 'Object']:
checks.append('?%s' % parameter_name)
elif not can_omit_type_check(test_type, i):
« no previous file with comments | « sdk/lib/web_audio/dartium/web_audio_dartium.dart ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698