Skip to content

Commit

Permalink
Fix Context.childContext(null) to default to empty context_values obj…
Browse files Browse the repository at this point in the history
…ect (#282)

* Fix Context.childContext to default to {} on undefined AND null

Fixes #277

* Context type updates & UnfilteredContext bug fix

Updated Context constructor to indicate that a Library can be passed in as the parent.  Updated PatientContext and UnfilteredContext library property to indicate it is, in fact, a Library. In the process of doing this, discovered code that was looking for expression identifiers at the root of the Library object instead of Library.expressions.  Oops!  Fixed it.

* Upgrade gradle wrapper

* npm audit fix + npm install --save-dev mocha@latest
  • Loading branch information
cmoesel authored and birick1 committed Jan 15, 2023
1 parent 997f321 commit 739fbe0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/browser/cql4browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8251,7 +8251,7 @@ class UnfilteredContext extends Context {
rootContext() {
return this;
}
async findRecords(_template) {
findRecords(_template) {
throw new exception_1.Exception('Retrieves are not currently supported in Unfiltered Context');
}
getLibraryContext(_library) {
Expand Down
10 changes: 5 additions & 5 deletions src/runtime/context.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as dt from '../datatypes/datatypes';
import { Exception } from '../datatypes/exception';
import { Library } from '../elm/library';
import { PatientObject, RetrieveDetails, TerminologyProvider } from '../types';
import { Parameter } from '../types/runtime.types';
import { typeIsArray } from '../util/util';
import * as dt from '../datatypes/datatypes';
import { MessageListener, NullMessageListener } from './messageListeners';
import { Parameter } from '../types/runtime.types';
import { PatientObject, RetrieveDetails, TerminologyProvider } from '../types';
import { Library } from '../elm/library';

export class Context {
// Public Constructor args
Expand Down Expand Up @@ -482,7 +482,7 @@ export class UnfilteredContext extends Context {
return this;
}

async findRecords(_template: any) {
findRecords(_template: any) {
throw new Exception('Retrieves are not currently supported in Unfiltered Context');
}

Expand Down

0 comments on commit 739fbe0

Please # to comment.