define method
void
define(})
override
define a declaration in this namespace, the defined id could be different from declaration's id
Implementation
@override
void define(String id, dynamic decl,
{bool override = false, bool throws = true}) {
if (!symbols.containsKey(id)) {
symbols[id] = decl;
} else {
if (!override) {
if (throws) {
throw HTError.defined(id, HTErrorType.staticWarning);
}
} else {
// final existedValue = symbols[id];
// if (existedValue is HTDeclarationNamespace &&
// decl is HTDeclarationNamespace) {
// // TODO: merge namespace?
// } else {
// symbols[id] = decl;
// }
symbols[id] = decl;
}
}
}