lib/config/MWParserEnvironment.js
function(parsoidConfig, options) {
	options = options || {};

	// page information
	this.page = new Page();

	Object.assign(this, options);

	// Record time spent in various passes
	this.timeProfile = {};
	this.ioProfile = {};
	this.mwProfile = {};
	this.timeCategories = {};
	this.counts = {};

	// execution state
	this.setCaches({});

	// Configuration
	this.conf = {
		parsoid: parsoidConfig,
		wiki: null,
	};

	// FIXME: This is temporary and will be replaced after the call to
	// `switchToConfig`.  However, it may somehow be used in the
	// `ConfigRequest` along the way. Perhaps worth seeing if that can be
	// eliminated so `WikiConfig` can't be instantiated without a `resultConf`.
	console.assert(parsoidConfig.mwApiMap.has(options.prefix));
	this.conf.wiki = new WikiConfig(parsoidConfig, null, options.prefix);

	this.configureLogging();

	// FIXME: Continuing with the line above, we can't initialize a specific
	// page until we have the correct wiki config, since things like
	// namespace aliases may not be same as the baseconfig, which has an
	// effect on what are considered valid titles.  At present, the only
	// consequence should be that failed config requests would all be
	// attributed to the mainpage, which doesn't seem so bad.
	this.initializeForPageName(this.conf.wiki.mainpage);

	this.pipelineFactory = new ParserPipelineFactory(this);

	// Outstanding page requests (for templates etc)
	this.requestQueue = {};

	this.batcher = new Batcher(this);

	this.setResourceLimits();

	// Fragments have had `storeDataAttribs` called on them
	this.fragmentMap = new Map();
	this.fid = 1;
}
function(parsoidConfig, options) {
	options = options || {};

	// page information
	this.page = new Page();

	Object.assign(this, options);

	// Record time spent in various passes
	this.timeProfile = {};
	this.ioProfile = {};
	this.mwProfile = {};
	this.timeCategories = {};
	this.counts = {};

	// execution state
	this.setCaches({});

	// Configuration
	this.conf = {
		parsoid: parsoidConfig,
		wiki: null,
	};

	// FIXME: This is temporary and will be replaced after the call to
	// `switchToConfig`.  However, it may somehow be used in the
	// `ConfigRequest` along the way. Perhaps worth seeing if that can be
	// eliminated so `WikiConfig` can't be instantiated without a `resultConf`.
	console.assert(parsoidConfig.mwApiMap.has(options.prefix));
	this.conf.wiki = new WikiConfig(parsoidConfig, null, options.prefix);

	this.configureLogging();

	// FIXME: Continuing with the line above, we can't initialize a specific
	// page until we have the correct wiki config, since things like
	// namespace aliases may not be same as the baseconfig, which has an
	// effect on what are considered valid titles.  At present, the only
	// consequence should be that failed config requests would all be
	// attributed to the mainpage, which doesn't seem so bad.
	this.initializeForPageName(this.conf.wiki.mainpage);

	this.pipelineFactory = new ParserPipelineFactory(this);

	// Outstanding page requests (for templates etc)
	this.requestQueue = {};

	this.batcher = new Batcher(this);

	this.setResourceLimits();

	// Fragments have had `storeDataAttribs` called on them
	this.fragmentMap = new Map();
	this.fid = 1;
}
function ( parsoidConfig , options ) { options = options || { } ; // page information this . page = new Page ( ) ; Object . assign ( this , options ) ; // Record time spent in various passes this . timeProfile = { } ; this . ioProfile = { } ; this . mwProfile = { } ; this . timeCategories = { } ; this . counts = { } ; // execution state this . setCaches ( { } ) ; // Configuration this . conf = { parsoid : parsoidConfig , wiki : null , } ; // FIXME: This is temporary and will be replaced after the call to // `switchToConfig`.  However, it may somehow be used in the // `ConfigRequest` along the way. Perhaps worth seeing if that can be // eliminated so `WikiConfig` can't be instantiated without a `resultConf`. console . assert ( parsoidConfig . mwApiMap . has ( options . prefix ) ) ; this . conf . wiki = new WikiConfig ( parsoidConfig , null , options . prefix ) ; this . configureLogging ( ) ; // FIXME: Continuing with the line above, we can't initialize a specific // page until we have the correct wiki config, since things like // namespace aliases may not be same as the baseconfig, which has an // effect on what are considered valid titles.  At present, the only // consequence should be that failed config requests would all be // attributed to the mainpage, which doesn't seem so bad. this . initializeForPageName ( this . conf . wiki . mainpage ) ; this . pipelineFactory = new ParserPipelineFactory ( this ) ; // Outstanding page requests (for templates etc) this . requestQueue = { } ; this . batcher = new Batcher ( this ) ; this . setResourceLimits ( ) ; // Fragments have had `storeDataAttribs` called on them this . fragmentMap = new Map ( ) ; this . fid = 1 ; }
Holds configuration data that isn't modified at runtime, debugging objects,
a page object that represents the page we're parsing, and more.
The title of the page is held in `this.page.name` and is stored
as a "true" url-decoded title, ie without any url-encoding which
might be necessary if the title were referenced in wikitext.

Should probably be constructed with {@link .getParserEnv}.

@class
@param {ParsoidConfig} parsoidConfig
@param {Object} [options]
Holds configuration data that isn t modified at runtime debugging objects a page object that represents the page we re parsing and more . The title of the page is held in this . page . name and is stored as a true url - decoded title ie without any url - encoding which might be necessary if the title were referenced in wikitext .