| 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 library dart2js.constant_system.js; | 5 library dart2js.constant_system.js; |
| 6 | 6 |
| 7 import '../constant_system_dart.dart'; | 7 import '../constant_system_dart.dart'; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../common_elements.dart' show CommonElements; | 10 import '../common_elements.dart' show CommonElements; |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 type, keysList, values, protoValue, onlyStringKeys); | 386 type, keysList, values, protoValue, onlyStringKeys); |
| 387 } | 387 } |
| 388 | 388 |
| 389 @override | 389 @override |
| 390 ConstantValue createSymbol(CommonElements commonElements, String text) { | 390 ConstantValue createSymbol(CommonElements commonElements, String text) { |
| 391 InterfaceType type = commonElements.symbolImplementationType; | 391 InterfaceType type = commonElements.symbolImplementationType; |
| 392 FieldEntity field = commonElements.symbolField; | 392 FieldEntity field = commonElements.symbolField; |
| 393 ConstantValue argument = createString(text); | 393 ConstantValue argument = createString(text); |
| 394 // TODO(johnniwinther): Use type arguments when all uses no longer expect | 394 // TODO(johnniwinther): Use type arguments when all uses no longer expect |
| 395 // a [FieldElement]. | 395 // a [FieldElement]. |
| 396 Map<FieldEntity, ConstantValue> fields = <dynamic, ConstantValue>{ | 396 Map<dynamic, ConstantValue> fields = <dynamic, ConstantValue>{ |
| 397 field: argument | 397 field: argument |
| 398 }; | 398 }; |
| 399 return new ConstructedConstantValue(type, fields); | 399 return new ConstructedConstantValue(type, fields); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 class JavaScriptMapConstant extends MapConstantValue { | 403 class JavaScriptMapConstant extends MapConstantValue { |
| 404 /** | 404 /** |
| 405 * The [PROTO_PROPERTY] must not be used as normal property in any JavaScript | 405 * The [PROTO_PROPERTY] must not be used as normal property in any JavaScript |
| 406 * object. It would change the prototype chain. | 406 * object. It would change the prototype chain. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 434 result.add(keyList); | 434 result.add(keyList); |
| 435 } else { | 435 } else { |
| 436 // Add the keys individually to avoid generating an unused list constant | 436 // Add the keys individually to avoid generating an unused list constant |
| 437 // for the keys. | 437 // for the keys. |
| 438 result.addAll(keys); | 438 result.addAll(keys); |
| 439 } | 439 } |
| 440 result.addAll(values); | 440 result.addAll(values); |
| 441 return result; | 441 return result; |
| 442 } | 442 } |
| 443 } | 443 } |
| OLD | NEW |