angular-cn/tools/transpiler/spec/fixtures/annotations.dart

23 lines
494 B
Dart
Raw Normal View History

import 'dart:mirrors';
// This class is not generated,
2014-09-25 17:30:10 -04:00
// but should be in the future.
//
// Problems:
// - Dart requires annotations to be const (which makes sense).
// Right now, I can't describe that in ES6.
class Provide {
final token;
const Provide(this.token);
}
class CONST {
const CONST();
}
// TODO: this api does not yet return an array as we don't have
// a nice array wrapper for Dart
readFirstAnnotation(clazz) {
2014-09-25 17:30:10 -04:00
return reflectClass(clazz).metadata.first.reflectee;
}