Re-add required properties. Fixes #61.
This commit is contained in:
parent
00d144bc08
commit
fec9ff60ac
@ -79,6 +79,17 @@ tree.Definition.prototype.toXML = function(env) {
|
||||
sym = sym[0];
|
||||
}
|
||||
|
||||
if (sym) {
|
||||
if (reqfail = tree.Reference.requiredProperties(
|
||||
sym,
|
||||
this.unique_rules())) {
|
||||
env.error({
|
||||
message: reqfail,
|
||||
index: this.unique_rules()[0] && this.unique_rules()[0].index
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var symname = sym ? sym.charAt(0).toUpperCase()
|
||||
+ sym.slice(1).replace(/\-./, function(str) {
|
||||
return str[1].toUpperCase();
|
||||
|
@ -620,8 +620,11 @@ tree.Reference.requiredPropertyList = function(symbolizer_name) {
|
||||
return properties;
|
||||
};
|
||||
|
||||
tree.Reference.requiredProperties = function(symbolizer_name, properties) {
|
||||
tree.Reference.requiredProperties = function(symbolizer_name, rules) {
|
||||
var req = tree.Reference.requiredPropertyList(symbolizer_name);
|
||||
var properties = rules.map(function(r) {
|
||||
return r.name;
|
||||
});
|
||||
for (i in req) {
|
||||
if (properties.indexOf(req[i]) === -1) {
|
||||
return 'Property ' + req[i] + ' required for defining '
|
||||
|
Loading…
Reference in New Issue
Block a user