| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.program_builder; | 5 library dart2js.js_emitter.program_builder; |
| 6 | 6 |
| 7 import 'js_emitter.dart' show computeMixinClass; | 7 import 'js_emitter.dart' show computeMixinClass; |
| 8 import 'model.dart'; | 8 import 'model.dart'; |
| 9 | 9 |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // TODO(kasperl): This clearly doesn't work yet. | 428 // TODO(kasperl): This clearly doesn't work yet. |
| 429 js.Expression code = js.string("<<unimplemented>>"); | 429 js.Expression code = js.string("<<unimplemented>>"); |
| 430 return new StaticMethod(element, | 430 return new StaticMethod(element, |
| 431 name, _registry.registerHolder(holder), code); | 431 name, _registry.registerHolder(holder), code); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void _registerConstants(OutputUnit outputUnit, | 434 void _registerConstants(OutputUnit outputUnit, |
| 435 List<ConstantValue> constantValues) { | 435 List<ConstantValue> constantValues) { |
| 436 if (constantValues == null) return; | 436 if (constantValues == null) return; |
| 437 for (ConstantValue constantValue in constantValues) { | 437 for (ConstantValue constantValue in constantValues) { |
| 438 _registry.registerConstant(outputUnit, constantValue); |
| 438 assert(!_constants.containsKey(constantValue)); | 439 assert(!_constants.containsKey(constantValue)); |
| 439 String name = namer.constantName(constantValue); | 440 String name = namer.constantName(constantValue); |
| 440 String constantObject = namer.globalObjectForConstant(constantValue); | 441 String constantObject = namer.globalObjectForConstant(constantValue); |
| 441 Holder holder = _registry.registerHolder(constantObject); | 442 Holder holder = _registry.registerHolder(constantObject); |
| 442 Constant constant = new Constant(name, holder, constantValue); | 443 Constant constant = new Constant(name, holder, constantValue); |
| 443 _constants[constantValue] = constant; | 444 _constants[constantValue] = constant; |
| 444 }; | 445 }; |
| 445 } | 446 } |
| 446 } | 447 } |
| OLD | NEW |