OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Top level generator object for writing code and keeping track of | 6 * Top level generator object for writing code and keeping track of |
7 * dependencies. | 7 * dependencies. |
8 * | 8 * |
9 * Should have two compilation models, but only one implemented so far. | 9 * Should have two compilation models, but only one implemented so far. |
10 * | 10 * |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 writeType(Type type) { | 328 writeType(Type type) { |
329 if (type.isWritten) return; | 329 if (type.isWritten) return; |
330 | 330 |
331 type.isWritten = true; | 331 type.isWritten = true; |
332 writeType(type.genericType); | 332 writeType(type.genericType); |
333 // Ensure parent has been written before the child. Important ordering for | 333 // Ensure parent has been written before the child. Important ordering for |
334 // IE when we're using $inherits, since we don't have __proto__ available. | 334 // IE when we're using $inherits, since we don't have __proto__ available. |
335 if (type.parent != null && !type.isNative) { | 335 if (type.parent != null) { |
336 writeType(type.parent); | 336 writeType(type.parent); |
337 } | 337 } |
338 | 338 |
339 var typeName = type.jsname != null ? type.jsname : 'top level'; | 339 var typeName = type.jsname != null ? type.jsname : 'top level'; |
340 writer.comment('// ********** Code for ${typeName} **************'); | 340 writer.comment('// ********** Code for ${typeName} **************'); |
341 if (type.isNative && !type.isTop && !type.isConcreteGeneric) { | 341 if (type.isNative && !type.isTop && !type.isConcreteGeneric) { |
342 var nativeName = type.definition.nativeType.name; | 342 var nativeName = type.definition.nativeType.name; |
343 if (nativeName == '') { | 343 if (nativeName == '') { |
344 writer.writeln('function ${type.jsname}() {}'); | 344 writer.writeln('function ${type.jsname}() {}'); |
345 } else if (type.jsname != nativeName) { | 345 } else if (type.jsname != nativeName) { |
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 return true; | 2430 return true; |
2431 } | 2431 } |
2432 | 2432 |
2433 } | 2433 } |
2434 | 2434 |
2435 class ReturnKind { | 2435 class ReturnKind { |
2436 static final int IGNORE = 1; | 2436 static final int IGNORE = 1; |
2437 static final int POST = 2; | 2437 static final int POST = 2; |
2438 static final int PRE = 3; | 2438 static final int PRE = 3; |
2439 } | 2439 } |
OLD | NEW |