Skip to content

Commit

Permalink
fix(ts): Workaround for typescript issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thekalinga committed Feb 2, 2017
1 parent dfc780d commit e82ff16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/interceptor-request-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import { InterceptorUtils } from './interceptor-utils';

export class InterceptorRequestInternal extends InterceptorRequest {

/**
* Hack
* TODO: Point to typescript bug
*/
constructor() {
super(null);
}

getShortCircuitAtCurrentStep(): boolean {
return this._shortCircuitAtCurrentStep;
}
Expand Down
5 changes: 3 additions & 2 deletions src/interceptor-response-wrapper-builder-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export class InterceptorResponseWrapperBuilderInternal extends InterceptorRespon
} else if (from instanceof InterceptorResponseWrapper) {
InterceptorUtils.assign(builder, <InterceptorResponseWrapper>from);
} else {
const request: InterceptorRequestInternal = <InterceptorRequestInternal>from;
InterceptorUtils.assign(builder, request);
const request: InterceptorRequestInternal = new InterceptorRequestInternal();
InterceptorUtils.assign(request, from);
InterceptorUtils.assign(builder, from);
if (request.getShortCircuitAtCurrentStep()) {
builder.shortCircuitTriggeredBy(interceptorStep - 1)
.forceRequestCompletion(request.getAlsoForceRequestCompletion());
Expand Down

0 comments on commit e82ff16

Please sign in to comment.