Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
R3TestBedCompiler.prototype.getOverriddenProviders = function (providers) {
var _this = this;
if (!providers || !providers.length || this.providerOverridesByToken.size === 0)
return [];
var overrides = this.getProviderOverrides(providers);
var hasMultiProviderOverrides = overrides.some(isMultiProvider);
var overriddenProviders = tslib_1.__spread(providers, overrides);
// No additional processing is required in case we have no multi providers to override
if (!hasMultiProviderOverrides) {
return overriddenProviders;
}
var final = [];
var seenMultiProviders = new Set();
// We iterate through the list of providers in reverse order to make sure multi provider
// overrides take precedence over the values defined in provider list. We also fiter out all
// multi providers that have overrides, keeping overridden values only.
forEachRight(overriddenProviders, function (provider) {
var token = getProviderToken(provider);
if (isMultiProvider(provider) && _this.providerOverridesByToken.has(token)) {
if (!seenMultiProviders.has(token)) {
seenMultiProviders.add(token);
if (provider && provider.useValue && Array.isArray(provider.useValue)) {
forEachRight(provider.useValue, function (value) {
var fnArgValues = [];
for (var argName in vars) {
fnArgNames.push(argName);
fnArgValues.push(vars[argName]);
}
if (createSourceMap) {
// using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise
// E.g. ```
// function anonymous(a,b,c
// /**/) { ... }```
// We don't want to hard code this fact, so we auto detect it via an empty function first.
var emptyFn = new (Function.bind.apply(Function, tslib_1.__spread([void 0], fnArgNames.concat('return null;'))))().toString();
var headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\n').length - 1;
fnBody += "\n" + ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment();
}
return new (Function.bind.apply(Function, tslib_1.__spread([void 0], fnArgNames.concat(fnBody))))().apply(void 0, tslib_1.__spread(fnArgValues));
}
function jitStatements(sourceUrl, statements, reflector, createSourceMaps) {
TestBedViewEngine.prototype.configureTestingModule = function (moduleDef) {
var _a, _b, _c, _d;
this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');
if (moduleDef.providers) {
(_a = this._providers).push.apply(_a, tslib_1.__spread(moduleDef.providers));
}
if (moduleDef.declarations) {
(_b = this._declarations).push.apply(_b, tslib_1.__spread(moduleDef.declarations));
}
if (moduleDef.imports) {
(_c = this._imports).push.apply(_c, tslib_1.__spread(moduleDef.imports));
}
if (moduleDef.schemas) {
(_d = this._schemas).push.apply(_d, tslib_1.__spread(moduleDef.schemas));
}
if (moduleDef.aotSummaries) {
this._aotSummaries.push(moduleDef.aotSummaries);
}
};
TestBedViewEngine.prototype.compileComponents = function () {
TestBedViewEngine.prototype.configureTestingModule = function (moduleDef) {
var _a, _b, _c, _d;
this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');
if (moduleDef.providers) {
(_a = this._providers).push.apply(_a, __spread(moduleDef.providers));
}
if (moduleDef.declarations) {
(_b = this._declarations).push.apply(_b, __spread(moduleDef.declarations));
}
if (moduleDef.imports) {
(_c = this._imports).push.apply(_c, __spread(moduleDef.imports));
}
if (moduleDef.schemas) {
(_d = this._schemas).push.apply(_d, __spread(moduleDef.schemas));
}
if (moduleDef.aotSummaries) {
this._aotSummaries.push(moduleDef.aotSummaries);
}
};
TestBedViewEngine.prototype.compileComponents = function () {
function () {
var _this = this;
/** @type {?} */
var starContainer = this.mainElement.nativeElement;
/** @type {?} */
var maxStars = tslib_1.__spread(Array(Number(this.totalstars)).keys());
this.stars.length = 0;
starContainer.innerHTML = "";
maxStars.forEach((/**
* @param {?} starNumber
* @return {?}
*/
function (starNumber) {
/** @type {?} */
var starElement = document.createElement("span");
starElement.dataset.index = (starNumber + 1).toString();
starElement.title = starElement.dataset.index;
starContainer.appendChild(starElement);
_this.stars.push(starElement);
}));
};
/**
function (key) {
var interpolateParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
interpolateParams[_i - 1] = arguments[_i];
}
return this.store.select(ConfigState.getLocalization.apply(ConfigState, tslib_1.__spread([key], interpolateParams)));
};
/**
this._queriedTokens.forEach(function (matches) { allMatches.push.apply(allMatches, tslib_1.__spread(matches)); });
return allMatches;
factory = function () { return new ((classRef_1).bind.apply((classRef_1), tslib_1.__spread([void 0], injectArgs(provider.deps))))(); };
}
function (acc, curr) { return __spread(acc, Array.from(dialogElement.querySelectorAll(curr))); }), []);
if (dragHandles.length > 0) {
export function getRootComponents(target) {
return tslib_1.__spread(getRootContext(target).components);
}
/**