Skip to content

Commit

Permalink
fix the inner dependencies map key
Browse files Browse the repository at this point in the history
  • Loading branch information
peze committed Jan 5, 2024
1 parent 64426a0 commit eed6d15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/semantic.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ class TypeChecker {
const checker = new TypeChecker(source, realSpecPath, this.root, this.libraries, innerModule).check(depAst);
this.dependencies.set(aliasId, checker);
if(innerModule) {
this.innerDep.set(realSpecPath, checker.ast);
this.innerDep.set(aliasId, checker.ast);
}
this.usedExternModel.set(aliasId, new Set());
}
Expand Down
6 changes: 3 additions & 3 deletions test/semantic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6739,7 +6739,7 @@ describe('semantic', function () {
it('use inner module should ok', function () {
let ast = readAndParse('fixtures/multi_module/sdk.dara');

const userAst = ast.innerDep.get(path.join(__dirname, './fixtures/multi_module/model/user.dara'));
const userAst = ast.innerDep.get('User');
const [model] = userAst.moduleBody.nodes;
expect(model.type).to.be('model');
expect(model.modelName).to.eql({
Expand All @@ -6760,7 +6760,7 @@ describe('semantic', function () {
'index': 9
});

const utilAst = ast.innerDep.get(path.join(__dirname, './fixtures/multi_module/lib/util.dara'));
const utilAst = ast.innerDep.get('Util');
const [ func ] = utilAst.moduleBody.nodes;
expect(func.type).to.be('function');
expect(func.functionName).to.eql({
Expand All @@ -6779,7 +6779,7 @@ describe('semantic', function () {
'index': 4
});

const apiAst = ast.innerDep.get(path.join(__dirname, './fixtures/multi_module/api.dara'));
const apiAst = ast.innerDep.get('API');
const [ init, api ] = apiAst.moduleBody.nodes;
expect(init.type).to.be('init');
expect(api.type).to.be('api');
Expand Down

0 comments on commit eed6d15

Please sign in to comment.