| 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 /// Represents an entry's position in one of the global metadata arrays. | 7 /// Represents an entry's position in one of the global metadata arrays. |
| 8 /// | 8 /// |
| 9 /// [_rc] is used to count the number of references of the token in the | 9 /// [_rc] is used to count the number of references of the token in the |
| 10 /// ast for a program. | 10 /// ast for a program. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 if (element.name == redirectedElement.name) { | 240 if (element.name == redirectedElement.name) { |
| 241 map[element] = redirectedElement; | 241 map[element] = redirectedElement; |
| 242 break; | 242 break; |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 } else { | 246 } else { |
| 247 int i = source.requiredParameterCount; | 247 int i = source.requiredParameterCount; |
| 248 for (ParameterElement element in source.orderedOptionalParameters) { | 248 for (ParameterElement element in source.orderedOptionalParameters) { |
| 249 if (i >= target.requiredParameterCount && i < target.parameterCount) { | 249 if (i >= target.requiredParameterCount && i < target.parameterCount) { |
| 250 map[element] = target.orderedOptionalParameters[ | 250 map[element] = target |
| 251 i - target.requiredParameterCount]; | 251 .orderedOptionalParameters[i - target.requiredParameterCount]; |
| 252 } | 252 } |
| 253 ++i; | 253 ++i; |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 return map; | 256 return map; |
| 257 } | 257 } |
| 258 | 258 |
| 259 jsAst.Expression reifyMetadata(MetadataAnnotation annotation) { | 259 jsAst.Expression reifyMetadata(MetadataAnnotation annotation) { |
| 260 ConstantValue constant = | 260 ConstantValue constant = |
| 261 _backend.constants.getConstantValueForMetadata(annotation); | 261 _backend.constants.getConstantValueForMetadata(annotation); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 if (token is _ForwardingMetadataEntry && !token.isBound) { | 420 if (token is _ForwardingMetadataEntry && !token.isBound) { |
| 421 _foundUnboundToken = true; | 421 _foundUnboundToken = true; |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 | 424 |
| 425 bool findUnboundPlaceholders(jsAst.Node node) { | 425 bool findUnboundPlaceholders(jsAst.Node node) { |
| 426 node.accept(this); | 426 node.accept(this); |
| 427 return _foundUnboundToken; | 427 return _foundUnboundToken; |
| 428 } | 428 } |
| 429 } | 429 } |
| OLD | NEW |