@angular/core 15.0.0-rc.4 → 15.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/core_private_export.mjs +2 -1
- package/esm2020/src/error_details_base_url.mjs +6 -2
- package/esm2020/src/metadata/directives.mjs +1 -1
- package/esm2020/src/render3/i18n/i18n_parse.mjs +3 -2
- package/esm2020/src/render3/instructions/listener.mjs +6 -5
- package/esm2020/src/render3/node_manipulation.mjs +11 -20
- package/esm2020/src/sanitization/bypass.mjs +4 -3
- package/esm2020/src/sanitization/html_sanitizer.mjs +3 -2
- package/esm2020/src/sanitization/sanitization.mjs +3 -3
- package/esm2020/src/sanitization/url_sanitizer.mjs +3 -2
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/test_bed.mjs +13 -2
- package/fesm2015/core.mjs +28 -33
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +39 -33
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +28 -33
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +39 -33
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +14 -3
- package/package.json +1 -1
- package/testing/index.d.ts +7 -1
package/fesm2020/testing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.
|
|
2
|
+
* @license Angular v15.1.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getDebugNode as getDebugNode$1, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ɵisEnvironmentProviders, ModuleWithComponentFactories, ɵconvertToBitFlags, Injector as Injector$1, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
7
|
+
import { getDebugNode as getDebugNode$1, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ɵisEnvironmentProviders, ModuleWithComponentFactories, ɵconvertToBitFlags, Injector as Injector$1, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, EnvironmentInjector as EnvironmentInjector$1, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
8
8
|
import { ResourceLoader } from '@angular/compiler';
|
|
9
9
|
import { Subject, Subscription } from 'rxjs';
|
|
10
10
|
|
|
@@ -906,11 +906,15 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
|
|
|
906
906
|
/**
|
|
907
907
|
* Base URL for the error details page.
|
|
908
908
|
*
|
|
909
|
-
* Keep
|
|
909
|
+
* Keep this constant in sync across:
|
|
910
910
|
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
|
|
911
911
|
* - packages/core/src/error_details_base_url.ts
|
|
912
912
|
*/
|
|
913
913
|
const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
|
|
914
|
+
/**
|
|
915
|
+
* URL for the XSS security documentation.
|
|
916
|
+
*/
|
|
917
|
+
const XSS_SECURITY_URL = 'https://g.co/ng/security#xss';
|
|
914
918
|
|
|
915
919
|
/**
|
|
916
920
|
* @license
|
|
@@ -6817,26 +6821,17 @@ function processCleanups(tView, lView) {
|
|
|
6817
6821
|
if (tCleanup !== null) {
|
|
6818
6822
|
for (let i = 0; i < tCleanup.length - 1; i += 2) {
|
|
6819
6823
|
if (typeof tCleanup[i] === 'string') {
|
|
6820
|
-
// This is a native DOM listener
|
|
6821
|
-
|
|
6822
|
-
const
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
if (typeof useCaptureOrSubIdx === 'boolean') {
|
|
6828
|
-
// native DOM listener registered with Renderer3
|
|
6829
|
-
target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);
|
|
6824
|
+
// This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=
|
|
6825
|
+
// 2 at the end of this block).
|
|
6826
|
+
const targetIdx = tCleanup[i + 3];
|
|
6827
|
+
ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');
|
|
6828
|
+
if (targetIdx >= 0) {
|
|
6829
|
+
// unregister
|
|
6830
|
+
lCleanup[lastLCleanupIndex = targetIdx]();
|
|
6830
6831
|
}
|
|
6831
6832
|
else {
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
lCleanup[lastLCleanupIndex = useCaptureOrSubIdx]();
|
|
6835
|
-
}
|
|
6836
|
-
else {
|
|
6837
|
-
// Subscription
|
|
6838
|
-
lCleanup[lastLCleanupIndex = -useCaptureOrSubIdx].unsubscribe();
|
|
6839
|
-
}
|
|
6833
|
+
// Subscription
|
|
6834
|
+
lCleanup[lastLCleanupIndex = -targetIdx].unsubscribe();
|
|
6840
6835
|
}
|
|
6841
6836
|
i += 2;
|
|
6842
6837
|
}
|
|
@@ -7692,7 +7687,7 @@ class SafeValueImpl {
|
|
|
7692
7687
|
}
|
|
7693
7688
|
toString() {
|
|
7694
7689
|
return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
|
|
7695
|
-
` (see
|
|
7690
|
+
` (see ${XSS_SECURITY_URL})`;
|
|
7696
7691
|
}
|
|
7697
7692
|
}
|
|
7698
7693
|
class SafeHtmlImpl extends SafeValueImpl {
|
|
@@ -7730,7 +7725,7 @@ function allowSanitizationBypassAndThrow(value, type) {
|
|
|
7730
7725
|
// Allow ResourceURLs in URL contexts, they are strictly more trusted.
|
|
7731
7726
|
if (actualType === "ResourceURL" /* BypassType.ResourceUrl */ && type === "URL" /* BypassType.Url */)
|
|
7732
7727
|
return true;
|
|
7733
|
-
throw new Error(`Required a safe ${type}, got a ${actualType} (see
|
|
7728
|
+
throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
|
|
7734
7729
|
}
|
|
7735
7730
|
return actualType === type;
|
|
7736
7731
|
}
|
|
@@ -7970,7 +7965,7 @@ function _sanitizeUrl(url) {
|
|
|
7970
7965
|
if (url.match(SAFE_URL_PATTERN))
|
|
7971
7966
|
return url;
|
|
7972
7967
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
7973
|
-
console.warn(`WARNING: sanitizing unsafe URL value ${url} (see
|
|
7968
|
+
console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
|
|
7974
7969
|
}
|
|
7975
7970
|
return 'unsafe:' + url;
|
|
7976
7971
|
}
|
|
@@ -8198,7 +8193,7 @@ function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
|
|
|
8198
8193
|
const sanitizer = new SanitizingHtmlSerializer();
|
|
8199
8194
|
const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
|
|
8200
8195
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {
|
|
8201
|
-
console.warn(
|
|
8196
|
+
console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);
|
|
8202
8197
|
}
|
|
8203
8198
|
return trustedHTMLFromString(safeHtml);
|
|
8204
8199
|
}
|
|
@@ -8345,8 +8340,7 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
8345
8340
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
8346
8341
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
8347
8342
|
}
|
|
8348
|
-
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
|
|
8349
|
-
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
|
8343
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
|
|
8350
8344
|
}
|
|
8351
8345
|
/**
|
|
8352
8346
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -9531,7 +9525,7 @@ class Version {
|
|
|
9531
9525
|
/**
|
|
9532
9526
|
* @publicApi
|
|
9533
9527
|
*/
|
|
9534
|
-
const VERSION = new Version('15.
|
|
9528
|
+
const VERSION = new Version('15.1.0-next.0');
|
|
9535
9529
|
|
|
9536
9530
|
/**
|
|
9537
9531
|
* @license
|
|
@@ -16136,7 +16130,8 @@ const isObservable = isSubscribable;
|
|
|
16136
16130
|
*
|
|
16137
16131
|
* @param eventName Name of the event
|
|
16138
16132
|
* @param listenerFn The function to be called when event emits
|
|
16139
|
-
* @param useCapture Whether or not to use capture in event listener
|
|
16133
|
+
* @param useCapture Whether or not to use capture in event listener - this argument is a reminder
|
|
16134
|
+
* from the Renderer3 infrastructure and should be removed from the instruction arguments
|
|
16140
16135
|
* @param eventTargetResolver Function that returns global target information in case this listener
|
|
16141
16136
|
* should be attached to a global object like window, document or body
|
|
16142
16137
|
*
|
|
@@ -16146,7 +16141,7 @@ function ɵɵlistener(eventName, listenerFn, useCapture, eventTargetResolver) {
|
|
|
16146
16141
|
const lView = getLView();
|
|
16147
16142
|
const tView = getTView();
|
|
16148
16143
|
const tNode = getCurrentTNode();
|
|
16149
|
-
listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn,
|
|
16144
|
+
listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);
|
|
16150
16145
|
return ɵɵlistener;
|
|
16151
16146
|
}
|
|
16152
16147
|
/**
|
|
@@ -16176,7 +16171,7 @@ function ɵɵsyntheticHostListener(eventName, listenerFn) {
|
|
|
16176
16171
|
const tView = getTView();
|
|
16177
16172
|
const currentDef = getCurrentDirectiveDef(tView.data);
|
|
16178
16173
|
const renderer = loadComponentRenderer(currentDef, tNode, lView);
|
|
16179
|
-
listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn
|
|
16174
|
+
listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);
|
|
16180
16175
|
return ɵɵsyntheticHostListener;
|
|
16181
16176
|
}
|
|
16182
16177
|
/**
|
|
@@ -16209,7 +16204,7 @@ function findExistingListener(tView, lView, eventName, tNodeIdx) {
|
|
|
16209
16204
|
}
|
|
16210
16205
|
return null;
|
|
16211
16206
|
}
|
|
16212
|
-
function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
16207
|
+
function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {
|
|
16213
16208
|
const isTNodeDirectiveHost = isDirectiveHost(tNode);
|
|
16214
16209
|
const firstCreatePass = tView.firstCreatePass;
|
|
16215
16210
|
const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);
|
|
@@ -21536,7 +21531,7 @@ function walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, up
|
|
|
21536
21531
|
ngDevMode &&
|
|
21537
21532
|
console.warn(`WARNING: ignoring unsafe attribute value ` +
|
|
21538
21533
|
`${lowerAttrName} on element ${tagName} ` +
|
|
21539
|
-
`(see
|
|
21534
|
+
`(see ${XSS_SECURITY_URL})`);
|
|
21540
21535
|
}
|
|
21541
21536
|
}
|
|
21542
21537
|
else {
|
|
@@ -26386,6 +26381,14 @@ class TestBedImpl {
|
|
|
26386
26381
|
static get(token, notFoundValue = Injector$1.THROW_IF_NOT_FOUND, flags = InjectFlags$1.Default) {
|
|
26387
26382
|
return TestBedImpl.INSTANCE.inject(token, notFoundValue, flags);
|
|
26388
26383
|
}
|
|
26384
|
+
/**
|
|
26385
|
+
* Runs the given function in the `EnvironmentInjector` context of `TestBed`.
|
|
26386
|
+
*
|
|
26387
|
+
* @see EnvironmentInjector#runInContext
|
|
26388
|
+
*/
|
|
26389
|
+
static runInInjectionContext(fn) {
|
|
26390
|
+
return TestBedImpl.INSTANCE.runInInjectionContext(fn);
|
|
26391
|
+
}
|
|
26389
26392
|
static createComponent(component) {
|
|
26390
26393
|
return TestBedImpl.INSTANCE.createComponent(component);
|
|
26391
26394
|
}
|
|
@@ -26521,6 +26524,9 @@ class TestBedImpl {
|
|
|
26521
26524
|
get(token, notFoundValue = Injector$1.THROW_IF_NOT_FOUND, flags = InjectFlags$1.Default) {
|
|
26522
26525
|
return this.inject(token, notFoundValue, flags);
|
|
26523
26526
|
}
|
|
26527
|
+
runInInjectionContext(fn) {
|
|
26528
|
+
return this.inject(EnvironmentInjector$1).runInContext(fn);
|
|
26529
|
+
}
|
|
26524
26530
|
execute(tokens, fn, context) {
|
|
26525
26531
|
const params = tokens.map(t => this.inject(t));
|
|
26526
26532
|
return fn.apply(context, params);
|