type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
async processInitialize(context: InitializationContext) {
context.setStartingPosition(EventPosition.earliest());
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processEvents(events: ReceivedEventData[], context: PartitionContext) {
processedAtLeastOneEvent.add(context.partitionId);
!partionCount[context.partitionId]
? (partionCount[context.partitionId] = 1)
: partionCount[context.partitionId]++;
const existingEven... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processError(err: Error) {
didError = true;
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processInitialize(context: InitializationContext) {
loggerForTest(`processInitialize(${context.partitionId})`);
partitionResultsMap.get(context.partitionId)!.initialized = true;
context.setStartingPosition(EventPosition.earliest());
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processClose(reason: CloseReason, context: PartitionContext) {
loggerForTest(`processClose(${context.partitionId})`);
partitionResultsMap.get(context.partitionId)!.closeReason = reason;
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processEvents(events: ReceivedEventData[], context: PartitionContext) {
partitionOwnershipArr.add(context.partitionId);
const existingEvents = partitionResultsMap.get(context.partitionId)!.events;
existingEvents.push(...events.map((event) => event.body));
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processError(err: Error, context: PartitionContext) {
loggerForTest(`processError(${context.partitionId})`);
didError = true;
errorName = err.name;
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processInitialization(context: InitializationContext) {
context.setStartingPosition(EventPosition.earliest());
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processEvents(events: ReceivedEventData[], context: PartitionContext) {
partitionOwnershipArr.add(context.partitionId);
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processError() {
didError = true;
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processInitialize(context) {
const eventProcessorId: string = (context as any).eventProcessorId;
const partitionId = context.partitionId;
loggerForTest(`[${eventProcessorId}] Claimed partition ${partitionId}`);
// For this test we don't want to actually checkpoint, just te... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processEvents() {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processError() {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processClose(reason, context) {
const eventProcessorId: string = (context as any).eventProcessorId;
const partitionId = context.partitionId;
const claimedPartitions = claimedPartitionsMap[eventProcessorId];
claimedPartitions.delete(partitionId);
loggerForTest(
... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processInitialization(context: InitializationContext) {
context.setStartingPosition(EventPosition.latest());
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processEvents(events: ReceivedEventData[], context: PartitionContext) {
partitionIdsSet.add(context.partitionId);
lastEnqueuedEventPropertiesMap.set(
context.partitionId,
context.lastEnqueuedEventProperties!
);
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async processError(err: Error, context: PartitionContext) {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
() => {
viewportContext(['desktop'], () => {
before(() => {
cy.window().then((win) => win.sessionStorage.clear());
});
describe('Anonymous user', () => {
it('should redirect to login page', () => {
cy.visit(updateEmail.UPDATE_EMAIL_URL);
cy.location('pathname').should('contai... | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
before(() => {
cy.window().then((win) => win.sessionStorage.clear());
});
describe('Anonymous user', () => {
it('should redirect to login page', () => {
cy.visit(updateEmail.UPDATE_EMAIL_URL);
cy.location('pathname').should('contain', '/login');
});
});
d... | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
cy.window().then((win) => win.sessionStorage.clear());
} | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
(win) => win.sessionStorage.clear() | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
it('should redirect to login page', () => {
cy.visit(updateEmail.UPDATE_EMAIL_URL);
cy.location('pathname').should('contain', '/login');
});
} | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
cy.visit(updateEmail.UPDATE_EMAIL_URL);
cy.location('pathname').should('contain', '/login');
} | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
before(() => {
updateEmail.registerAndLogin();
cy.visit('/');
});
beforeEach(() => {
cy.restoreLocalStorage();
cy.selectUserMenuOption({
option: 'Email Address',
});
});
updateEmail.testUpdateEmailAndLogin();
afterEach(() ... | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
updateEmail.registerAndLogin();
cy.visit('/');
} | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
cy.restoreLocalStorage();
cy.selectUserMenuOption({
option: 'Email Address',
});
} | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
cy.saveLocalStorage();
} | I539321/spartacus | projects/storefrontapp-e2e-cypress/cypress/integration/regression/my-account/update-email.core-e2e-spec.ts | TypeScript |
FunctionDeclaration |
export function renderIncoterm(params: GridCellParams) {
return <Incoterm value={params.value!} />;
} | Chriserus/material-ui-x | packages/grid/x-grid-data-generator/src/renderer/renderIncoterm.tsx | TypeScript |
InterfaceDeclaration |
interface IncotermProps {
value: GridCellValue;
} | Chriserus/material-ui-x | packages/grid/x-grid-data-generator/src/renderer/renderIncoterm.tsx | TypeScript |
InterfaceDeclaration |
export interface Events {
applicationCommandCreate: { command: ApplicationCommand };
applicationCommandDelete: { command: ApplicationCommand };
applicationCommandUpdate: {
oldCommand: ApplicationCommand | null;
newCommand: ApplicationCommand;
};
channelCreate: { channel: GuildChannel };
channelDele... | zorbyte/koppa | lib/events/events.ts | TypeScript |
TypeAliasDeclaration |
export type EventsMap = {
[E in keyof Events]: UnionToTuple<keyof Events[E]>;
}; | zorbyte/koppa | lib/events/events.ts | TypeScript |
ArrowFunction |
(props: SVGAttributes<SVGSVGElement>, ref: Ref<SVGSVGElement>) => (
<svg viewBox="0 0 24 24" | imshubhamsingh/iris | src/icons/ui/Sparkle.tsx | TypeScript |
FunctionDeclaration |
function prepareProps<TValue, TProps extends { value?: any }>(
props: WrappedProps<TValue, TProps>,
): PreparedProps<TProps> {
// @ts-ignore Rest types may only be created from object types
const { required, email, validations = [], renderErrorMessage, ...rest } = props;
const value = props.value;
const con... | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
FunctionDeclaration |
function wrapControl<TComponent extends React.ComponentType<ExtractProps<TComponent>>>(
controlType: TComponent,
): React.ComponentType<
WrappedProps<
ExtractValue<TComponent>,
JSX.LibraryManagedAttributes<TComponent, { value?: ExtractValue<TComponent> } & ExtractProps<TComponent>>
>
> {
return (props)... | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
FunctionDeclaration |
export function lessThanDate(value: Date): (value: Nullable<string>) => Nullable<ValidationInfo> {
return (actualValue) => {
const actual = parseDate(actualValue);
if (actual && !(actual < value)) {
return { message: 'Значение должно быть меньше чем ' + value.toString() };
}
return undefined;
... | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
FunctionDeclaration |
function parseDate(value: Nullable<string>): Nullable<Date> {
if (!value) {
return null;
}
const match = /(\d{2}).(\d{2})\.(\d{4})/.exec(value);
if (!match) {
return null;
}
const [, dd, mm, yyyy] = match;
return new Date(`${yyyy}.${mm}.${dd}`);
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
(x) => () => x(value) | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
() => x(value) | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
() => {
if (!value) {
return { type: 'submit', message: 'Поле необходимо заполнить' };
}
return undefined;
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
() => {
if (typeof value !== 'string' || !value.includes('@')) {
return { message: 'Почта указана неверно' };
}
return undefined;
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
(result, validation) => {
const validationResult = validation();
if (validationResult) {
return { ...validationResult, ...(result as any) };
}
return result;
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
(props) => {
const { controlProps, validationWrapperProps } = prepareProps(props);
const control = React.createElement(controlType, controlProps) as React.ReactElement<any>;
return React.createElement(ValidationWrapper, validationWrapperProps, control);
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
(actualValue) => {
const actual = parseDate(actualValue);
if (actual && !(actual < value)) {
return { message: 'Значение должно быть меньше чем ' + value.toString() };
}
return undefined;
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
InterfaceDeclaration |
interface ValidationProps<TValue> {
required?: boolean;
email?: boolean;
validations?: Array<(value: Nullable<TValue>) => Nullable<ValidationInfo>>;
renderErrorMessage?: RenderErrorMessage;
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
InterfaceDeclaration |
interface PreparedProps<TProps> {
validationWrapperProps: {
validationInfo: Nullable<ValidationInfo>;
renderMessage: Nullable<RenderErrorMessage>;
};
controlProps: TProps;
} | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
TypeAliasDeclaration |
type WrappedProps<TValue, TProps extends { value?: TValue }> = TProps & ValidationProps<TValue>; | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
TypeAliasDeclaration |
type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends React.ComponentType<infer P>
? P extends { value?: any }
? P
: never
: never; | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
TypeAliasDeclaration |
type ExtractValue<TComponent> = ExtractProps<TComponent> extends { value?: null | infer TValue } ? TValue : never; | Lelchik/retail-ui | packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts | TypeScript |
ArrowFunction |
() => {
return applyDecorators(
ApiBearerAuth(),
ApiOperation({ summary: '[ADMIN] get genre by genre id' }),
ApiOkResponse({ description: 'get genre by genre id', type: SuccessReturnGenreSwagger }),
ApiBadRequestResponse({
description: CommonErrorMessages.ID_INVALID,
type: BadRequestInvalidIdSwagger,
... | Ha1lowe3n/online-cinema-backend | src/genre/swagger/decorators/get-genre-by-id.swagger.decorator.ts | TypeScript |
ClassDeclaration |
@Module({
imports: [
MongooseModule.forFeature([{ name: 'Group', schema: GroupSchema }]),
],
providers: [GroupsService, GroupsResolver],
exports: [GroupsService],
})
export class GroupsModule {} | MeStrak/catkin | backend/src/group/groups.module.ts | TypeScript |
ArrowFunction |
() => {
let component: TableCellAppInstancesComponent<any>;
let fixture: ComponentFixture<TableCellAppInstancesComponent<any>>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
TableCellAppInstancesComponent,
RunningInstancesComponent
],
imports: [
... | 3v1lW1th1n/stratos | src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app/table-cell-app-instances/table-cell-app-instances.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [
TableCellAppInstancesComponent,
RunningInstancesComponent
],
imports: [
...generateCfStoreModules(),
CoreModule,
],
providers: [
PaginationMonitorFactory
]
})
.compileCompo... | 3v1lW1th1n/stratos | src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app/table-cell-app-instances/table-cell-app-instances.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(TableCellAppInstancesComponent);
component = fixture.componentInstance;
component.row = { entity: {}, metadata: {} };
fixture.detectChanges();
} | 3v1lW1th1n/stratos | src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app/table-cell-app-instances/table-cell-app-instances.component.spec.ts | TypeScript |
FunctionDeclaration |
export function getElementDepthCount() {
return instructionState.lFrame.elementDepthCount;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function increaseElementDepthCount() {
instructionState.lFrame.elementDepthCount++;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function decreaseElementDepthCount() {
instructionState.lFrame.elementDepthCount--;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getBindingsEnabled(): boolean {
return instructionState.bindingsEnabled;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Enables directive matching on elements.
*
* * Example:
* ```
* <my-comp my-directive>
* Should match component / directive.
* </my-comp>
* <div ngNonBindable>
* <!-- ɵɵdisableBindings() -->
* <my-comp my-directive>
* Should not match component / directive because we are in ngNonBindable.
* ... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Disables directive matching on element.
*
* * Example:
* ```
* <my-comp my-directive>
* Should match component / directive.
* </my-comp>
* <div ngNonBindable>
* <!-- ɵɵdisableBindings() -->
* <my-comp my-directive>
* Should not match component / directive because we are in ngNonBindable.
* ... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Return the current `LView`.
*/
export function getLView(): LView {
return instructionState.lFrame.lView;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Return the current `TView`.
*/
export function getTView(): TView {
return instructionState.lFrame.tView;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Restores `contextViewData` to the given OpaqueViewState instance.
*
* Used in conjunction with the getCurrentView() instruction to save a snapshot
* of the current view and restore it when listeners are invoked. This allows
* walking the declaration view tree in listeners to get vars from parent views.
*
*... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getPreviousOrParentTNode(): TNode {
return instructionState.lFrame.previousOrParentTNode;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setPreviousOrParentTNode(tNode: TNode, isParent: boolean) {
instructionState.lFrame.previousOrParentTNode = tNode;
instructionState.lFrame.isParent = isParent;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getIsParent(): boolean {
return instructionState.lFrame.isParent;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setIsNotParent(): void {
instructionState.lFrame.isParent = false;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setIsParent(): void {
instructionState.lFrame.isParent = true;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getContextLView(): LView {
return instructionState.lFrame.contextLView;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getCheckNoChangesMode(): boolean {
// TODO(misko): remove this from the LView since it is ngDevMode=true mode only.
return instructionState.checkNoChangesMode;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setCheckNoChangesMode(mode: boolean): void {
instructionState.checkNoChangesMode = mode;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | // top level variables should not be exported for performance reasons (PERF_NOTES.md)
export function getBindingRoot() {
const lFrame = instructionState.lFrame;
let index = lFrame.bindingRootIndex;
if (index === -1) {
index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;
}
return index;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getBindingIndex(): number {
return instructionState.lFrame.bindingIndex;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setBindingIndex(value: number): number {
return instructionState.lFrame.bindingIndex = value;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function nextBindingIndex(): number {
return instructionState.lFrame.bindingIndex++;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function incrementBindingIndex(count: number): number {
const lFrame = instructionState.lFrame;
const index = lFrame.bindingIndex;
lFrame.bindingIndex = lFrame.bindingIndex + count;
return index;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Set a new binding root index so that host template functions can execute.
*
* Bindings inside the host template are 0 index. But because we don't know ahead of time
* how many host bindings we have we can't pre-compute them. For this reason they are all
* 0 index and we just shift the root so that they match... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* When host binding is executing this points to the directive index.
* `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`
* `LView[getCurrentDirectiveIndex()]` is directive instance.
*/
export function getCurrentDirectiveIndex(): number {
return instructionState.lFrame.currentDirectiveIndex;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getCurrentQueryIndex(): number {
return instructionState.lFrame.currentQueryIndex;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setCurrentQueryIndex(value: number): void {
instructionState.lFrame.currentQueryIndex = value;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* This is a light weight version of the `enterView` which is needed by the DI system.
* @param newView
* @param tNode
*/
export function enterDI(newView: LView, tNode: TNode) {
ngDevMode && assertLViewOrUndefined(newView);
const newLFrame = allocLFrame();
instructionState.lFrame = newLFrame;
newLFrame.p... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Swap the current lView with a new lView.
*
* For performance reasons we store the lView in the top level of the module.
* This way we minimize the number of properties to read. Whenever a new view
* is entered we have to store the lView for later, and when the view is
* exited the state has to be restored
... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.
*/
function allocLFrame() {
const currentLFrame = instructionState.lFrame;
const childLFrame = currentLFrame === null ? null : currentLFrame.child;
const newLFrame = childLFrame === null ? createLFrame(current... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
function createLFrame(parent: LFrame|null): LFrame {
const lFrame: LFrame = {
previousOrParentTNode: null!, //
isParent: true, //
lView: null!, //
tView: null!, //
selectedIndex: 0, //
contextLView: null!, //
element... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* A lightweight version of leave which is used with DI.
*
* This function only resets `previousOrParentTNode` and `LView` as those are the only properties
* used with DI (`enterDI()`).
*
* NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where
* as `leaveViewLight` ... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Leave the current `LView`
*
* This pops the `LFrame` with the associated `LView` from the stack.
*
* IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is
* because for performance reasons we don't release `LFrame` but rather keep it for next use.
*/
export function ... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function nextContextImpl<T = any>(level: number): T {
const contextLView = instructionState.lFrame.contextLView =
walkUpViews(level, instructionState.lFrame.contextLView!);
return contextLView[CONTEXT] as T;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
function walkUpViews(nestingLevel: number, currentView: LView): LView {
while (nestingLevel > 0) {
ngDevMode &&
assertDefined(
currentView[DECLARATION_VIEW],
'Declaration view should be defined if nesting level is greater than 0.');
currentView = currentView[DECLARATION_VIEW]!... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Gets the currently selected element index.
*
* Used with {@link property} instruction (and more in the future) to identify the index in the
* current `LView` to act on.
*/
export function getSelectedIndex() {
return instructionState.lFrame.selectedIndex;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Sets the most recent index passed to {@link select}
*
* Used with {@link property} instruction (and more in the future) to identify the index in the
* current `LView` to act on.
*
* (Note that if an "exit function" was set earlier (via `setElementExitFn()`) then that will be
* run if and when the provided ... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Gets the `tNode` that represents currently selected element.
*/
export function getSelectedTNode() {
const lFrame = instructionState.lFrame;
return getTNode(lFrame.tView, lFrame.selectedIndex);
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
*
* @codeGenApi
*/
export function ɵɵnamespaceSVG() {
instructionState.lFrame.currentNamespace = SVG_NAMESPACE;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.
*
* @codeGenApi
*/
export function ɵɵnamespaceMathML() {
instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Sets the namespace used to create elements to `null`, which forces element creation to use
* `createElement` rather than `createElementNS`.
*
* @codeGenApi
*/
export function ɵɵnamespaceHTML() {
namespaceHTMLInternal();
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration | /**
* Sets the namespace used to create elements to `null`, which forces element creation to use
* `createElement` rather than `createElementNS`.
*/
export function namespaceHTMLInternal() {
instructionState.lFrame.currentNamespace = null;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getNamespace(): string|null {
return instructionState.lFrame.currentNamespace;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function setCurrentStyleSanitizer(sanitizer: StyleSanitizeFn|null) {
instructionState.lFrame.currentSanitizer = sanitizer;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function resetCurrentStyleSanitizer() {
setCurrentStyleSanitizer(null);
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
FunctionDeclaration |
export function getCurrentStyleSanitizer() {
// TODO(misko): This should throw when there is no LView, but it turns out we can get here from
// `NodeStyleDebug` hence we return `null`. This should be fixed
const lFrame = instructionState.lFrame;
return lFrame === null ? null : lFrame.currentSanitizer;
} | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
InterfaceDeclaration | /**
*
*/
interface LFrame {
/**
* Parent LFrame.
*
* This is needed when `leaveView` is called to restore the previous state.
*/
parent: LFrame;
/**
* Child LFrame.
*
* This is used to cache existing LFrames to relieve the memory pressure.
*/
child: LFrame|null;
/**
* State of t... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
InterfaceDeclaration | /**
* All implicit instruction state is stored here.
*
* It is useful to have a single object where all of the state is stored as a mental model
* (rather it being spread across many different variables.)
*
* PERF NOTE: Turns out that writing to a true global variable is slower than
* having an intermediate obje... | 63isOK/angular | packages/core/src/render3/state.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.