Victor Berchet 089a2f1b62 feat(transpiler): constructor and typed field semantics
fixes #11 (constructor and typed field semantics)
fixes #42 (Should we infer class property types from ctor args ?)
fixes #17 (number (js) should map to num (dart))

Closes #45
2014-10-02 21:02:47 -07:00

23 lines
494 B
Dart

import 'dart:mirrors';
// This class is not generated,
// 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) {
return reflectClass(clazz).metadata.first.reflectee;
}