Skip to content

Commit

Permalink
Merge pull request #707 from embroider-build/fixup-new-babel-typings
Browse files Browse the repository at this point in the history
Fixup types for newer @babel/types.
  • Loading branch information
rwjblue authored Mar 4, 2021
2 parents 9d13424 + ae11381 commit 221831a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/babel-plugin-adjust-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export default function main() {
) {
let { opts, emberCLIVanillaJobs } = state;
const { source } = path.node;
if (source === null) {
if (source === null || source === undefined) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/macros/tests/babel/eval.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('evaluation', function () {
});
});

function nodePathNotNull(path: NodePath<Expression | null>): path is NodePath<Expression> {
function isNodePathPresent(path: NodePath<Expression | null | undefined>): path is NodePath<Expression> {
return path.node != null;
}

Expand All @@ -120,7 +120,7 @@ function testEval() {
exit(path: NodePath<VariableDeclarator>) {
let id = path.get('id').node;
let value = path.get('init');
if (isIdentifier(id) && id.name === 'result' && nodePathNotNull(value)) {
if (isIdentifier(id) && id.name === 'result' && isNodePathPresent(value)) {
let evaluator = new Evaluator({
locals: {
knownValue: 2,
Expand Down

0 comments on commit 221831a

Please sign in to comment.