On this page

Represents InitFragment.

new InitFragment(content, stage, position, key?, endContent?): InitFragment
Attributes
the source code that will be included as initialization code
stage:<number>
category of initialization code (contribute to order)
position:<number>
position in the category (contribute to order)
unique key to avoid emitting the same initialization code twice
endContent:<string> | <Source>
the source code that will be included at the end of the module

Creates an instance of InitFragment.

Attributes
content:<string> | <Source>
endContent:<string> | <Source>
position:<number>
stage:<number>
STAGE_ASYNC_BOUNDARY:<number>
STAGE_ASYNC_DEPENDENCIES:<number>
STAGE_ASYNC_HARMONY_IMPORTS:<number>
STAGE_CONSTANTS:<number>
STAGE_HARMONY_EXPORTS:<number>
STAGE_HARMONY_IMPORTS:<number>
STAGE_PROVIDES:<number>
deserialize(context): void
Attributes
Returns:<void>

Restores this instance from the provided deserializer context.


getContent(context): string | Source | undefined
Attributes
context
the source code that will be included as initialization code

Returns the source code that will be included as initialization code.


getEndContent(context): string | Source | undefined
Attributes
context
the source code that will be included at the end of the module

Returns the source code that will be included at the end of the module.


serialize(context): void
Attributes
Returns:<void>

Serializes this instance into the provided serializer context.


Attributes
source:<Source>
sources
< <Context> >[] init fragments
context:
{Context} context
Returns:<Source>
source

Adds the provided source to the init fragment.