Skip to content

Commit

Permalink
fix: Take inheritance into account during analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein authored and amiller-gh committed Mar 2, 2018
1 parent 3656360 commit ea06441
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/css-blocks/src/Block/Inheritable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export abstract class Inheritable<
* inheritance. Does not include this object or the styles it implies through
* other relationships to this object.
*
* The values are returned in inheritance order, with the first value
* returned (if any) having no base, and the the last value returned (if any)
* being the base of this object.
*
* If nothing is inherited, this returns an empty array.
* @returns The array of nodes this node inherits from.
*/
Expand All @@ -127,7 +131,7 @@ export abstract class Inheritable<

/**
* Resolves the child with the given name from this node's inheritance
* chain. Returns undefined if the child is not found.
* chain. Returns null if the child is not found.
* @param name The name of the child to resolve.
* @returns The child node, or `null`
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/jsx/src/utils/ExpressionReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class ExpressionReader {
let dynamicStateExpression: Expression = <Expression>this.callExpression!.arguments[0];
return { block, blockClass, stateGroup, dynamicStateExpression };
} else if (this.stateValue) {
let state = stateGroup.getState(this.stateValue);
let state = stateGroup.resolveState(this.stateValue);
if (!state) {
let message = `No state ${stateGroup.asSource(this.stateValue)} found on block "${this.block}".`;
let valueNames = [...stateGroup.statesMap().values()].map(s => s.asSource());
Expand Down

0 comments on commit ea06441

Please sign in to comment.