Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Changes to align with shim refactors #346

Merged
merged 2 commits into from
Jul 26, 2017
Merged

Conversation

kitsonk
Copy link
Member

@kitsonk kitsonk commented Jul 7, 2017

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

These PRs are updates to keep in sync with changes in PR dojo/shim#101

src/aspect.ts Outdated
@@ -281,7 +281,7 @@ function getDispatcherObject(target: Targetable, methodName: string): Dispatcher
function getJoinPointDispatcher<F extends GenericFunction<T>, T>(joinPoint: F): F {

function dispatcher(this: Function, ...args: any[]): T {
const { before, after, joinPoint } = dispatchAdviceMap.get(dispatcher);
const { before, after, joinPoint } = dispatchAdviceMap.get(dispatcher)!;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be ignoring the strict null checks, I believe you mentioned that it can now correctly return undefined so we should probably guard against that appropriately.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating this, since from the code below, you could never get a situation where the map for the dispatcher is undefined, because the only way the way the function could be called is if its map had been set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added comments to document the use of not null assertion is appropriate because we can't logically have undefined values from the maps.

@kitsonk kitsonk requested a review from rorticus July 26, 2017 18:00
@kitsonk kitsonk merged commit 8f4ed92 into dojo:master Jul 26, 2017
@dylans dylans added this to the 2017.07 milestone Aug 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants