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

Side by Side Diff: lib/dom/scripts/systemfrog.py

Issue 10388084: Better support for the case of typed arrays inheriting from other typed arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: better comment Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/dom/scripts/generator.py ('k') | lib/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the systems to generate 6 """This module provides shared functionality for the systems to generate
7 frog binding from the IDL database.""" 7 frog binding from the IDL database."""
8 8
9 import os 9 import os
10 from generator import * 10 from generator import *
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ' throw new UnsupportedOperationException("Cannot assign element of immutable List.");\n' 337 ' throw new UnsupportedOperationException("Cannot assign element of immutable List.");\n'
338 ' }\n', 338 ' }\n',
339 TYPE=self._NarrowInputType(element_type)) 339 TYPE=self._NarrowInputType(element_type))
340 340
341 # TODO(sra): Use separate mixins for mutable implementations of List<T>. 341 # TODO(sra): Use separate mixins for mutable implementations of List<T>.
342 # TODO(sra): Use separate mixins for typed array implementations of List<T>. 342 # TODO(sra): Use separate mixins for typed array implementations of List<T>.
343 template_file = 'immutable_list_mixin.darttemplate' 343 template_file = 'immutable_list_mixin.darttemplate'
344 template = self._system._templates.Load(template_file) 344 template = self._system._templates.Load(template_file)
345 self._members_emitter.Emit(template, E=DartType(element_type)) 345 self._members_emitter.Emit(template, E=DartType(element_type))
346 346
347 def AmendIndexer(self, element_type):
348 pass
347 349
348 def AddOperation(self, info): 350 def AddOperation(self, info):
349 """ 351 """
350 Arguments: 352 Arguments:
351 info: An OperationInfo object. 353 info: An OperationInfo object.
352 """ 354 """
353 # TODO(vsm): Handle overloads. 355 # TODO(vsm): Handle overloads.
354 params = info.ParametersImplementationDeclaration( 356 params = info.ParametersImplementationDeclaration(
355 lambda type_name: self._NarrowInputType(type_name)) 357 lambda type_name: self._NarrowInputType(type_name))
356 358
357 native_string = '' 359 native_string = ''
358 if info.declared_name != info.name: 360 if info.declared_name != info.name:
359 native_string = " '%s'" % info.declared_name 361 native_string = " '%s'" % info.declared_name
360 362
361 native_body = dom_frog_native_bodies.get( 363 native_body = dom_frog_native_bodies.get(
362 self._interface.id + '.' + info.name, '') 364 self._interface.id + '.' + info.name, '')
363 if native_body: 365 if native_body:
364 native_string = " '''" + native_body + "'''" 366 native_string = " '''" + native_body + "'''"
365 367
366 self._members_emitter.Emit( 368 self._members_emitter.Emit(
367 '\n' 369 '\n'
368 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', 370 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n',
369 TYPE=self._NarrowOutputType(info.type_name), 371 TYPE=self._NarrowOutputType(info.type_name),
370 NAME=info.name, 372 NAME=info.name,
371 PARAMS=params, 373 PARAMS=params,
372 NATIVESTRING=native_string) 374 NATIVESTRING=native_string)
373 375
374 def AddStaticOperation(self, info): 376 def AddStaticOperation(self, info):
375 pass 377 pass
OLDNEW
« no previous file with comments | « lib/dom/scripts/generator.py ('k') | lib/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698