From 744172cc8cf9fad25c6ef07eac2b27cedf390c4e Mon Sep 17 00:00:00 2001 From: Andrew Schmadel Date: Tue, 4 Sep 2018 12:56:31 -0400 Subject: [PATCH] Correctly resolve attributes w/ external types Correctly handles cases where an external attribute may have a type from yet another namespace. --- src/parser/Rule.ts | 4 ++-- src/xml/TypeSpec.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser/Rule.ts b/src/parser/Rule.ts index 3dbd40d..268c700 100644 --- a/src/parser/Rule.ts +++ b/src/parser/Rule.ts @@ -54,8 +54,8 @@ export class Rule { this.handler = handler; } - addAttribute(ref: MemberRef) { - this.attributeTbl[ref.member.namespace.getPrefix() + ref.member.name] = ref; + addAttribute(ref: MemberRef, namespace: Namespace) { + this.attributeTbl[namespace.getPrefix() + ref.member.name] = ref; } addChild(ref: MemberRef) { diff --git a/src/xml/TypeSpec.ts b/src/xml/TypeSpec.ts index e72f510..a94bb4d 100644 --- a/src/xml/TypeSpec.ts +++ b/src/xml/TypeSpec.ts @@ -173,7 +173,7 @@ export class TypeSpec extends Item { for(spec of this.attributeSpecList) { var attributeRef = MemberRef.parseSpec(spec, this.namespace); - if(attributeRef.member.typeSpecList) this.rule.addAttribute(attributeRef); + if(attributeRef.member.typeSpecList) this.rule.addAttribute(attributeRef, this.namespace); this.defineMember(attributeRef); } }