| 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 class ConstantEmitter { | 7 class ConstantEmitter { |
| 8 ConstantReferenceEmitter _referenceEmitter; | 8 ConstantReferenceEmitter _referenceEmitter; |
| 9 ConstantInitializerEmitter _initializerEmitter; | 9 ConstantInitializerEmitter _initializerEmitter; |
| 10 | 10 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } else if (field.name == MapConstant.KEYS_NAME) { | 262 } else if (field.name == MapConstant.KEYS_NAME) { |
| 263 arguments.add(_reference(constant.keys)); | 263 arguments.add(_reference(constant.keys)); |
| 264 } else if (field.name == MapConstant.PROTO_VALUE) { | 264 } else if (field.name == MapConstant.PROTO_VALUE) { |
| 265 assert(constant.protoValue != null); | 265 assert(constant.protoValue != null); |
| 266 arguments.add(_reference(constant.protoValue)); | 266 arguments.add(_reference(constant.protoValue)); |
| 267 } else { | 267 } else { |
| 268 badFieldCountError(); | 268 badFieldCountError(); |
| 269 } | 269 } |
| 270 emittedArgumentCount++; | 270 emittedArgumentCount++; |
| 271 }, | 271 }, |
| 272 includeBackendMembers: true, | 272 includeSuperAndInjectedMembers: true); |
| 273 includeSuperMembers: true); | |
| 274 | 273 |
| 275 if ((constant.protoValue == null && emittedArgumentCount != 3) || | 274 if ((constant.protoValue == null && emittedArgumentCount != 3) || |
| 276 (constant.protoValue != null && emittedArgumentCount != 4)) { | 275 (constant.protoValue != null && emittedArgumentCount != 4)) { |
| 277 badFieldCountError(); | 276 badFieldCountError(); |
| 278 } | 277 } |
| 279 | 278 |
| 280 return new jsAst.New( | 279 return new jsAst.New( |
| 281 new jsAst.VariableUse(getJsConstructor(classElement)), | 280 new jsAst.VariableUse(getJsConstructor(classElement)), |
| 282 arguments); | 281 arguments); |
| 283 } | 282 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 310 } | 309 } |
| 311 | 310 |
| 312 List<jsAst.Expression> _array(List<Constant> values) { | 311 List<jsAst.Expression> _array(List<Constant> values) { |
| 313 List<jsAst.Expression> valueList = <jsAst.Expression>[]; | 312 List<jsAst.Expression> valueList = <jsAst.Expression>[]; |
| 314 for (int i = 0; i < values.length; i++) { | 313 for (int i = 0; i < values.length; i++) { |
| 315 valueList.add(_reference(values[i])); | 314 valueList.add(_reference(values[i])); |
| 316 } | 315 } |
| 317 return valueList; | 316 return valueList; |
| 318 } | 317 } |
| 319 } | 318 } |
| OLD | NEW |