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

Side by Side Diff: client/dom/scripts/dartgenerator.py

Issue 8879044: Work-around Frog codegen bug where Window is derived from native DOMWindow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, 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 generates Dart APIs from the IDL database.""" 6 """This module generates Dart APIs from the IDL database."""
7 7
8 import emitter 8 import emitter
9 import idlnode 9 import idlnode
10 import logging 10 import logging
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 # Custom getters that must be implemented by hand. 114 # Custom getters that must be implemented by hand.
115 # 115 #
116 _custom_getters = set([ 116 _custom_getters = set([
117 ('DOMWindow', 'localStorage'), 117 ('DOMWindow', 'localStorage'),
118 ]) 118 ])
119 119
120 # 120 #
121 # Custom native specs for the Frog dom. 121 # Custom native specs for the Frog dom.
122 # 122 #
123 _frog_dom_custom_native_specs = { 123 _frog_dom_custom_native_specs = {
124 'Console': '=console', # Decorate the singleton Console object. 124 # Decorate the singleton Console object, if present (workers do not have a
125 'DOMWindow': '@*DOMWindow', # DOMWindow aliased with global scope. 125 # console).
126 'Console': "=(typeof console == 'undefined' ? {} : console)",
126 127
127 # Temporary hack: make these not be 'hidden'. Will not work on IE9. 128 # DOMWindow aliased with global scope.
129 'DOMWindow': '@*DOMWindow',
130
131 # Temporary hack: make these not be 'hidden', so that static methods can be
132 # put on them. Frog should be fixed to generate working code for static
133 # methods on hidden classes. Meantime, programs will not work on IE9.
128 'Float32Array': 'Float32Array', 134 'Float32Array': 'Float32Array',
129 'Float64Array': 'Float64Array', 135 'Float64Array': 'Float64Array',
130 'Int8Array': 'Int8Array', 136 'Int8Array': 'Int8Array',
131 'Int16Array': 'Int16Array', 137 'Int16Array': 'Int16Array',
132 'Int32Array': 'Int32Array', 138 'Int32Array': 'Int32Array',
133 'Uint8Array': 'Uint8Array', 139 'Uint8Array': 'Uint8Array',
134 'Uint16Array': 'Uint16Array', 140 'Uint16Array': 'Uint16Array',
135 'Uint32Array': 'Uint32Array', 141 'Uint32Array': 'Uint32Array',
136 } 142 }
137 143
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 Arguments: 2493 Arguments:
2488 info: An OperationInfo object. 2494 info: An OperationInfo object.
2489 """ 2495 """
2490 # TODO(vsm): Handle overloads. 2496 # TODO(vsm): Handle overloads.
2491 self._members_emitter.Emit( 2497 self._members_emitter.Emit(
2492 '\n' 2498 '\n'
2493 ' $TYPE $NAME($ARGS) native;\n', 2499 ' $TYPE $NAME($ARGS) native;\n',
2494 TYPE=info.type_name, 2500 TYPE=info.type_name,
2495 NAME=info.name, 2501 NAME=info.name,
2496 ARGS=info.arg_implementation_declaration) 2502 ARGS=info.arg_implementation_declaration)
OLDNEW
« no previous file with comments | « client/dom/generated/src/frog/Console.dart ('k') | client/dom/scripts/template_frog_dom.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698