Skip to content

Commit

Permalink
typecheck: allow passing a "null" scope to typeCheckInputArgs
Browse files Browse the repository at this point in the history
Because almond-dialog-agent indirectly does that when typechecking
predicates on their own
  • Loading branch information
gcampax committed Nov 1, 2019
1 parent e9fa3a9 commit 635777d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/typecheck.js
Expand Up @@ -629,8 +629,9 @@ function typeCheckInputArgs(ast, schema, scope, classes) {
if (ast.selector.isDevice) {
let dupes = new Set;

const attrscope = scope.clone();
attrscope.cleanOutput();
const attrscope = scope ? scope.clone() : null;
if (attrscope)
attrscope.cleanOutput();
for (let attr of ast.selector.attributes) {
if (dupes.has(attr.name))
throw new TypeError(`Duplicate device attribute ${attr.name}`);
Expand Down

0 comments on commit 635777d

Please sign in to comment.