Skip to content

Commit

Permalink
Correct getAllContext() behavior
Browse files Browse the repository at this point in the history
Correct getAllContext() to return the root node's context in addition to
specified defaults.

Closes: aws#2239
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
  • Loading branch information
nvinson committed Oct 7, 2024
1 parent 14fe346 commit d4d94b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ export class Node {
defaults = {};
}

if (this.scope === undefined) { return defaults; }

const value = { ...this._context, ...defaults };
if (this.scope === undefined) { return value; }

return this.scope && this.scope.node.getAllContext(value);
}

Expand Down

0 comments on commit d4d94b4

Please sign in to comment.