| 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 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); | 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); |
| 8 | 8 |
| 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); | 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); |
| 10 | 10 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 | 263 |
| 264 @override | 264 @override |
| 265 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { | 265 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { |
| 266 ClassElement interceptorClass = constant.dispatchedType.element; | 266 ClassElement interceptorClass = constant.dispatchedType.element; |
| 267 return backend.emitter.interceptorPrototypeAccess(interceptorClass); | 267 return backend.emitter.interceptorPrototypeAccess(interceptorClass); |
| 268 } | 268 } |
| 269 | 269 |
| 270 @override | 270 @override |
| 271 jsAst.Expression visitSynthetic(SyntheticConstantValue constant, [_]) { | 271 jsAst.Expression visitSynthetic(SyntheticConstantValue constant, [_]) { |
| 272 switch (constant.kind) { | 272 switch (constant.valueKind) { |
| 273 case SyntheticConstantKind.DUMMY_INTERCEPTOR: | 273 case SyntheticConstantKind.DUMMY_INTERCEPTOR: |
| 274 case SyntheticConstantKind.EMPTY_VALUE: | 274 case SyntheticConstantKind.EMPTY_VALUE: |
| 275 return new jsAst.LiteralNumber('0'); | 275 return new jsAst.LiteralNumber('0'); |
| 276 case SyntheticConstantKind.TYPEVARIABLE_REFERENCE: | 276 case SyntheticConstantKind.TYPEVARIABLE_REFERENCE: |
| 277 case SyntheticConstantKind.NAME: | 277 case SyntheticConstantKind.NAME: |
| 278 return constant.payload; | 278 return constant.payload; |
| 279 default: | 279 default: |
| 280 reporter.internalError(NO_LOCATION_SPANNABLE, | 280 reporter.internalError(NO_LOCATION_SPANNABLE, |
| 281 "Unexpected DummyConstantKind ${constant.kind}"); | 281 "Unexpected DummyConstantKind ${constant.kind}"); |
| 282 return null; | 282 return null; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 [value, argumentList]); | 322 [value, argumentList]); |
| 323 } | 323 } |
| 324 return value; | 324 return value; |
| 325 } | 325 } |
| 326 | 326 |
| 327 @override | 327 @override |
| 328 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 328 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
| 329 return constantReferenceGenerator(constant.referenced); | 329 return constantReferenceGenerator(constant.referenced); |
| 330 } | 330 } |
| 331 } | 331 } |
| OLD | NEW |