| Index: sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
|
| index 1c8cfa46a9149ff604843b987aba7004d00a0a65..0ebaf6fc2e5258986ef0907a60e3251e60ec87fc 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
|
| @@ -27,12 +27,12 @@ class MetadataEmitter extends CodeEmitterHelper {
|
| if (link != null) {
|
| for (; !link.isEmpty; link = link.tail) {
|
| MetadataAnnotation annotation = link.head;
|
| - Constant value =
|
| + ConstExp constant =
|
| backend.constants.getConstantForMetadata(annotation);
|
| - if (value == null) {
|
| + if (constant == null) {
|
| compiler.internalError(annotation, 'Annotation value is null.');
|
| } else {
|
| - metadata.add(task.constantReference(value));
|
| + metadata.add(task.constantReference(constant.value));
|
| }
|
| }
|
| }
|
| @@ -47,10 +47,10 @@ class MetadataEmitter extends CodeEmitterHelper {
|
| if (signature.optionalParameterCount == 0) return const [];
|
| List<int> defaultValues = <int>[];
|
| for (Element element in signature.optionalParameters) {
|
| - Constant value = backend.constants.getConstantForVariable(element);
|
| - String stringRepresentation = (value == null)
|
| + ConstExp constant = backend.constants.getConstantForVariable(element);
|
| + String stringRepresentation = (constant == null)
|
| ? "null"
|
| - : jsAst.prettyPrint(task.constantReference(value), compiler)
|
| + : jsAst.prettyPrint(task.constantReference(constant.value), compiler)
|
| .getText();
|
| defaultValues.add(addGlobalMetadata(stringRepresentation));
|
| }
|
| @@ -58,13 +58,14 @@ class MetadataEmitter extends CodeEmitterHelper {
|
| }
|
|
|
| int reifyMetadata(MetadataAnnotation annotation) {
|
| - Constant value = backend.constants.getConstantForMetadata(annotation);
|
| - if (value == null) {
|
| + ConstExp constant = backend.constants.getConstantForMetadata(annotation);
|
| + if (constant == null) {
|
| compiler.internalError(annotation, 'Annotation value is null.');
|
| return -1;
|
| }
|
| return addGlobalMetadata(
|
| - jsAst.prettyPrint(task.constantReference(value), compiler).getText());
|
| + jsAst.prettyPrint(
|
| + task.constantReference(constant.value), compiler).getText());
|
| }
|
|
|
| int reifyType(DartType type) {
|
|
|