| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dart2js.js_emitter.full_emitter.class_emitter; | 5 library dart2js.js_emitter.full_emitter.class_emitter; |
| 6 | 6 |
| 7 import '../../common.dart'; | 7 import '../../common.dart'; |
| 8 import '../../common/names.dart' show Names; | 8 import '../../common/names.dart' show Names; |
| 9 import '../../elements/resolution_types.dart' show ResolutionDartType; | 9 import '../../elements/resolution_types.dart' show ResolutionDartType; |
| 10 import '../../deferred_load.dart' show OutputUnit; | 10 import '../../deferred_load.dart' show OutputUnit; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 jsAst.ObjectInitializer initializer = | 332 jsAst.ObjectInitializer initializer = |
| 333 staticsBuilder.toObjectInitializer(); | 333 staticsBuilder.toObjectInitializer(); |
| 334 compiler.dumpInfoTask.registerElementAst(classElement, initializer); | 334 compiler.dumpInfoTask.registerElementAst(classElement, initializer); |
| 335 jsAst.Node property = initializer.properties.single; | 335 jsAst.Node property = initializer.properties.single; |
| 336 compiler.dumpInfoTask.registerElementAst(classElement, property); | 336 compiler.dumpInfoTask.registerElementAst(classElement, property); |
| 337 statics.add(property); | 337 statics.add(property); |
| 338 } | 338 } |
| 339 | 339 |
| 340 // TODO(herhut): Do not grab statics out of the properties. | 340 // TODO(herhut): Do not grab statics out of the properties. |
| 341 ClassBuilder classProperties = | 341 ClassBuilder classProperties = |
| 342 emitter.elementDescriptors[fragment].remove(classElement); | 342 emitter.classDescriptors[fragment]?.remove(classElement); |
| 343 if (classProperties != null) { | 343 if (classProperties != null) { |
| 344 statics.addAll(classProperties.properties); | 344 statics.addAll(classProperties.properties); |
| 345 } | 345 } |
| 346 | 346 |
| 347 if (!statics.isEmpty) { | 347 if (!statics.isEmpty) { |
| 348 classBuilder.addProperty( | 348 classBuilder.addProperty( |
| 349 namer.staticsPropertyName, // 'static' or its minified name. | 349 namer.staticsPropertyName, // 'static' or its minified name. |
| 350 new jsAst.ObjectInitializer(statics, isOneLiner: false)); | 350 new jsAst.ObjectInitializer(statics, isOneLiner: false)); |
| 351 } | 351 } |
| 352 | 352 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 String reflectionName = emitter.getReflectionName(selector, name); | 442 String reflectionName = emitter.getReflectionName(selector, name); |
| 443 if (reflectionName != null) { | 443 if (reflectionName != null) { |
| 444 var reflectable = js( | 444 var reflectable = js( |
| 445 backend.mirrorsData.isMemberAccessibleByReflection(member) | 445 backend.mirrorsData.isMemberAccessibleByReflection(member) |
| 446 ? '1' | 446 ? '1' |
| 447 : '0'); | 447 : '0'); |
| 448 builder.addPropertyByName('+$reflectionName', reflectable); | 448 builder.addPropertyByName('+$reflectionName', reflectable); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 } | 451 } |
| OLD | NEW |