(parentLocation: RelativeInjectorLocation)
| 20 | } |
| 21 | |
| 22 | export function getParentInjectorIndex(parentLocation: RelativeInjectorLocation): number { |
| 23 | if (ngDevMode) { |
| 24 | assertNumber(parentLocation, 'Number expected'); |
| 25 | assertNotEqual(parentLocation as any, -1, 'Not a valid state.'); |
| 26 | const parentInjectorIndex = parentLocation & RelativeInjectorLocationFlags.InjectorIndexMask; |
| 27 | |
| 28 | assertGreaterThan( |
| 29 | parentInjectorIndex, |
| 30 | HEADER_OFFSET, |
| 31 | 'Parent injector must be pointing past HEADER_OFFSET.', |
| 32 | ); |
| 33 | } |
| 34 | return parentLocation & RelativeInjectorLocationFlags.InjectorIndexMask; |
| 35 | } |
| 36 | |
| 37 | export function getParentInjectorViewOffset(parentLocation: RelativeInjectorLocation): number { |
| 38 | return parentLocation >> RelativeInjectorLocationFlags.ViewOffsetShift; |
no test coverage detected
searching dependent graphs…