1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { DebugElement__PRE_R3__, DebugEventListener, DebugNode__PRE_R3__, getDebugNode, indexDebugNode, removeDebugNodeFromIndex } from '../debug/debug_node';
|
---|
9 | import { resolveForwardRef } from '../di';
|
---|
10 | import { getInjectableDef } from '../di/interface/defs';
|
---|
11 | import { ErrorHandler } from '../error_handler';
|
---|
12 | import { RendererFactory2 } from '../render/api';
|
---|
13 | import { Sanitizer } from '../sanitization/sanitizer';
|
---|
14 | import { escapeCommentText } from '../util/dom';
|
---|
15 | import { isDevMode } from '../util/is_dev_mode';
|
---|
16 | import { normalizeDebugBindingName, normalizeDebugBindingValue } from '../util/ng_reflect';
|
---|
17 | import { isViewDebugError, viewDestroyedError, viewWrappedDebugError } from './errors';
|
---|
18 | import { resolveDep } from './provider';
|
---|
19 | import { dirtyParentQueries, getQueryValue } from './query';
|
---|
20 | import { createInjector, createNgModuleRef, getComponentViewDefinitionFactory } from './refs';
|
---|
21 | import { asElementData, asPureExpressionData, Services } from './types';
|
---|
22 | import { isComponentView, NOOP, renderNode, resolveDefinition, splitDepsDsl, tokenKey, viewParentEl } from './util';
|
---|
23 | import { checkAndUpdateNode, checkAndUpdateView, checkNoChangesNode, checkNoChangesView, createComponentView, createEmbeddedView, createRootView, destroyView } from './view';
|
---|
24 | let initialized = false;
|
---|
25 | export function initServicesIfNeeded() {
|
---|
26 | if (initialized) {
|
---|
27 | return;
|
---|
28 | }
|
---|
29 | initialized = true;
|
---|
30 | const services = isDevMode() ? createDebugServices() : createProdServices();
|
---|
31 | Services.setCurrentNode = services.setCurrentNode;
|
---|
32 | Services.createRootView = services.createRootView;
|
---|
33 | Services.createEmbeddedView = services.createEmbeddedView;
|
---|
34 | Services.createComponentView = services.createComponentView;
|
---|
35 | Services.createNgModuleRef = services.createNgModuleRef;
|
---|
36 | Services.overrideProvider = services.overrideProvider;
|
---|
37 | Services.overrideComponentView = services.overrideComponentView;
|
---|
38 | Services.clearOverrides = services.clearOverrides;
|
---|
39 | Services.checkAndUpdateView = services.checkAndUpdateView;
|
---|
40 | Services.checkNoChangesView = services.checkNoChangesView;
|
---|
41 | Services.destroyView = services.destroyView;
|
---|
42 | Services.resolveDep = resolveDep;
|
---|
43 | Services.createDebugContext = services.createDebugContext;
|
---|
44 | Services.handleEvent = services.handleEvent;
|
---|
45 | Services.updateDirectives = services.updateDirectives;
|
---|
46 | Services.updateRenderer = services.updateRenderer;
|
---|
47 | Services.dirtyParentQueries = dirtyParentQueries;
|
---|
48 | }
|
---|
49 | function createProdServices() {
|
---|
50 | return {
|
---|
51 | setCurrentNode: () => { },
|
---|
52 | createRootView: createProdRootView,
|
---|
53 | createEmbeddedView: createEmbeddedView,
|
---|
54 | createComponentView: createComponentView,
|
---|
55 | createNgModuleRef: createNgModuleRef,
|
---|
56 | overrideProvider: NOOP,
|
---|
57 | overrideComponentView: NOOP,
|
---|
58 | clearOverrides: NOOP,
|
---|
59 | checkAndUpdateView: checkAndUpdateView,
|
---|
60 | checkNoChangesView: checkNoChangesView,
|
---|
61 | destroyView: destroyView,
|
---|
62 | createDebugContext: (view, nodeIndex) => new DebugContext_(view, nodeIndex),
|
---|
63 | handleEvent: (view, nodeIndex, eventName, event) => view.def.handleEvent(view, nodeIndex, eventName, event),
|
---|
64 | updateDirectives: (view, checkType) => view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view),
|
---|
65 | updateRenderer: (view, checkType) => view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view),
|
---|
66 | };
|
---|
67 | }
|
---|
68 | function createDebugServices() {
|
---|
69 | return {
|
---|
70 | setCurrentNode: debugSetCurrentNode,
|
---|
71 | createRootView: debugCreateRootView,
|
---|
72 | createEmbeddedView: debugCreateEmbeddedView,
|
---|
73 | createComponentView: debugCreateComponentView,
|
---|
74 | createNgModuleRef: debugCreateNgModuleRef,
|
---|
75 | overrideProvider: debugOverrideProvider,
|
---|
76 | overrideComponentView: debugOverrideComponentView,
|
---|
77 | clearOverrides: debugClearOverrides,
|
---|
78 | checkAndUpdateView: debugCheckAndUpdateView,
|
---|
79 | checkNoChangesView: debugCheckNoChangesView,
|
---|
80 | destroyView: debugDestroyView,
|
---|
81 | createDebugContext: (view, nodeIndex) => new DebugContext_(view, nodeIndex),
|
---|
82 | handleEvent: debugHandleEvent,
|
---|
83 | updateDirectives: debugUpdateDirectives,
|
---|
84 | updateRenderer: debugUpdateRenderer,
|
---|
85 | };
|
---|
86 | }
|
---|
87 | function createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
|
---|
88 | const rendererFactory = ngModule.injector.get(RendererFactory2);
|
---|
89 | return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context);
|
---|
90 | }
|
---|
91 | function debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
|
---|
92 | const rendererFactory = ngModule.injector.get(RendererFactory2);
|
---|
93 | const root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode);
|
---|
94 | const defWithOverride = applyProviderOverridesToView(def);
|
---|
95 | return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]);
|
---|
96 | }
|
---|
97 | function createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) {
|
---|
98 | const sanitizer = ngModule.injector.get(Sanitizer);
|
---|
99 | const errorHandler = ngModule.injector.get(ErrorHandler);
|
---|
100 | const renderer = rendererFactory.createRenderer(null, null);
|
---|
101 | return {
|
---|
102 | ngModule,
|
---|
103 | injector: elInjector,
|
---|
104 | projectableNodes,
|
---|
105 | selectorOrNode: rootSelectorOrNode,
|
---|
106 | sanitizer,
|
---|
107 | rendererFactory,
|
---|
108 | renderer,
|
---|
109 | errorHandler
|
---|
110 | };
|
---|
111 | }
|
---|
112 | function debugCreateEmbeddedView(parentView, anchorDef, viewDef, context) {
|
---|
113 | const defWithOverride = applyProviderOverridesToView(viewDef);
|
---|
114 | return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]);
|
---|
115 | }
|
---|
116 | function debugCreateComponentView(parentView, nodeDef, viewDef, hostElement) {
|
---|
117 | const overrideComponentView = viewDefOverrides.get(nodeDef.element.componentProvider.provider.token);
|
---|
118 | if (overrideComponentView) {
|
---|
119 | viewDef = overrideComponentView;
|
---|
120 | }
|
---|
121 | else {
|
---|
122 | viewDef = applyProviderOverridesToView(viewDef);
|
---|
123 | }
|
---|
124 | return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]);
|
---|
125 | }
|
---|
126 | function debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) {
|
---|
127 | const defWithOverride = applyProviderOverridesToNgModule(def);
|
---|
128 | return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);
|
---|
129 | }
|
---|
130 | const providerOverrides = new Map();
|
---|
131 | const providerOverridesWithScope = new Map();
|
---|
132 | const viewDefOverrides = new Map();
|
---|
133 | function debugOverrideProvider(override) {
|
---|
134 | providerOverrides.set(override.token, override);
|
---|
135 | let injectableDef;
|
---|
136 | if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) &&
|
---|
137 | typeof injectableDef.providedIn === 'function') {
|
---|
138 | providerOverridesWithScope.set(override.token, override);
|
---|
139 | }
|
---|
140 | }
|
---|
141 | function debugOverrideComponentView(comp, compFactory) {
|
---|
142 | const hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));
|
---|
143 | const compViewDef = resolveDefinition(hostViewDef.nodes[0].element.componentView);
|
---|
144 | viewDefOverrides.set(comp, compViewDef);
|
---|
145 | }
|
---|
146 | function debugClearOverrides() {
|
---|
147 | providerOverrides.clear();
|
---|
148 | providerOverridesWithScope.clear();
|
---|
149 | viewDefOverrides.clear();
|
---|
150 | }
|
---|
151 | // Notes about the algorithm:
|
---|
152 | // 1) Locate the providers of an element and check if one of them was overwritten
|
---|
153 | // 2) Change the providers of that element
|
---|
154 | //
|
---|
155 | // We only create new data structures if we need to, to keep perf impact
|
---|
156 | // reasonable.
|
---|
157 | function applyProviderOverridesToView(def) {
|
---|
158 | if (providerOverrides.size === 0) {
|
---|
159 | return def;
|
---|
160 | }
|
---|
161 | const elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);
|
---|
162 | if (elementIndicesWithOverwrittenProviders.length === 0) {
|
---|
163 | return def;
|
---|
164 | }
|
---|
165 | // clone the whole view definition,
|
---|
166 | // as it maintains references between the nodes that are hard to update.
|
---|
167 | def = def.factory(() => NOOP);
|
---|
168 | for (let i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {
|
---|
169 | applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);
|
---|
170 | }
|
---|
171 | return def;
|
---|
172 | function findElementIndicesWithOverwrittenProviders(def) {
|
---|
173 | const elIndicesWithOverwrittenProviders = [];
|
---|
174 | let lastElementDef = null;
|
---|
175 | for (let i = 0; i < def.nodes.length; i++) {
|
---|
176 | const nodeDef = def.nodes[i];
|
---|
177 | if (nodeDef.flags & 1 /* TypeElement */) {
|
---|
178 | lastElementDef = nodeDef;
|
---|
179 | }
|
---|
180 | if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ &&
|
---|
181 | providerOverrides.has(nodeDef.provider.token)) {
|
---|
182 | elIndicesWithOverwrittenProviders.push(lastElementDef.nodeIndex);
|
---|
183 | lastElementDef = null;
|
---|
184 | }
|
---|
185 | }
|
---|
186 | return elIndicesWithOverwrittenProviders;
|
---|
187 | }
|
---|
188 | function applyProviderOverridesToElement(viewDef, elIndex) {
|
---|
189 | for (let i = elIndex + 1; i < viewDef.nodes.length; i++) {
|
---|
190 | const nodeDef = viewDef.nodes[i];
|
---|
191 | if (nodeDef.flags & 1 /* TypeElement */) {
|
---|
192 | // stop at the next element
|
---|
193 | return;
|
---|
194 | }
|
---|
195 | if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {
|
---|
196 | const provider = nodeDef.provider;
|
---|
197 | const override = providerOverrides.get(provider.token);
|
---|
198 | if (override) {
|
---|
199 | nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
|
---|
200 | provider.deps = splitDepsDsl(override.deps);
|
---|
201 | provider.value = override.value;
|
---|
202 | }
|
---|
203 | }
|
---|
204 | }
|
---|
205 | }
|
---|
206 | }
|
---|
207 | // Notes about the algorithm:
|
---|
208 | // We only create new data structures if we need to, to keep perf impact
|
---|
209 | // reasonable.
|
---|
210 | function applyProviderOverridesToNgModule(def) {
|
---|
211 | const { hasOverrides, hasDeprecatedOverrides } = calcHasOverrides(def);
|
---|
212 | if (!hasOverrides) {
|
---|
213 | return def;
|
---|
214 | }
|
---|
215 | // clone the whole view definition,
|
---|
216 | // as it maintains references between the nodes that are hard to update.
|
---|
217 | def = def.factory(() => NOOP);
|
---|
218 | applyProviderOverrides(def);
|
---|
219 | return def;
|
---|
220 | function calcHasOverrides(def) {
|
---|
221 | let hasOverrides = false;
|
---|
222 | let hasDeprecatedOverrides = false;
|
---|
223 | if (providerOverrides.size === 0) {
|
---|
224 | return { hasOverrides, hasDeprecatedOverrides };
|
---|
225 | }
|
---|
226 | def.providers.forEach(node => {
|
---|
227 | const override = providerOverrides.get(node.token);
|
---|
228 | if ((node.flags & 3840 /* CatProviderNoDirective */) && override) {
|
---|
229 | hasOverrides = true;
|
---|
230 | hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
|
---|
231 | }
|
---|
232 | });
|
---|
233 | def.modules.forEach(module => {
|
---|
234 | providerOverridesWithScope.forEach((override, token) => {
|
---|
235 | if (resolveForwardRef(getInjectableDef(token).providedIn) === module) {
|
---|
236 | hasOverrides = true;
|
---|
237 | hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
|
---|
238 | }
|
---|
239 | });
|
---|
240 | });
|
---|
241 | return { hasOverrides, hasDeprecatedOverrides };
|
---|
242 | }
|
---|
243 | function applyProviderOverrides(def) {
|
---|
244 | for (let i = 0; i < def.providers.length; i++) {
|
---|
245 | const provider = def.providers[i];
|
---|
246 | if (hasDeprecatedOverrides) {
|
---|
247 | // We had a bug where me made
|
---|
248 | // all providers lazy. Keep this logic behind a flag
|
---|
249 | // for migrating existing users.
|
---|
250 | provider.flags |= 4096 /* LazyProvider */;
|
---|
251 | }
|
---|
252 | const override = providerOverrides.get(provider.token);
|
---|
253 | if (override) {
|
---|
254 | provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
|
---|
255 | provider.deps = splitDepsDsl(override.deps);
|
---|
256 | provider.value = override.value;
|
---|
257 | }
|
---|
258 | }
|
---|
259 | if (providerOverridesWithScope.size > 0) {
|
---|
260 | let moduleSet = new Set(def.modules);
|
---|
261 | providerOverridesWithScope.forEach((override, token) => {
|
---|
262 | if (moduleSet.has(resolveForwardRef(getInjectableDef(token).providedIn))) {
|
---|
263 | let provider = {
|
---|
264 | token: token,
|
---|
265 | flags: override.flags | (hasDeprecatedOverrides ? 4096 /* LazyProvider */ : 0 /* None */),
|
---|
266 | deps: splitDepsDsl(override.deps),
|
---|
267 | value: override.value,
|
---|
268 | index: def.providers.length,
|
---|
269 | };
|
---|
270 | def.providers.push(provider);
|
---|
271 | def.providersByKey[tokenKey(token)] = provider;
|
---|
272 | }
|
---|
273 | });
|
---|
274 | }
|
---|
275 | }
|
---|
276 | }
|
---|
277 | function prodCheckAndUpdateNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
|
---|
278 | const nodeDef = view.def.nodes[checkIndex];
|
---|
279 | checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
|
---|
280 | return (nodeDef.flags & 224 /* CatPureExpression */) ?
|
---|
281 | asPureExpressionData(view, checkIndex).value :
|
---|
282 | undefined;
|
---|
283 | }
|
---|
284 | function prodCheckNoChangesNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
|
---|
285 | const nodeDef = view.def.nodes[checkIndex];
|
---|
286 | checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
|
---|
287 | return (nodeDef.flags & 224 /* CatPureExpression */) ?
|
---|
288 | asPureExpressionData(view, checkIndex).value :
|
---|
289 | undefined;
|
---|
290 | }
|
---|
291 | function debugCheckAndUpdateView(view) {
|
---|
292 | return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);
|
---|
293 | }
|
---|
294 | function debugCheckNoChangesView(view) {
|
---|
295 | return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);
|
---|
296 | }
|
---|
297 | function debugDestroyView(view) {
|
---|
298 | return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);
|
---|
299 | }
|
---|
300 | var DebugAction;
|
---|
301 | (function (DebugAction) {
|
---|
302 | DebugAction[DebugAction["create"] = 0] = "create";
|
---|
303 | DebugAction[DebugAction["detectChanges"] = 1] = "detectChanges";
|
---|
304 | DebugAction[DebugAction["checkNoChanges"] = 2] = "checkNoChanges";
|
---|
305 | DebugAction[DebugAction["destroy"] = 3] = "destroy";
|
---|
306 | DebugAction[DebugAction["handleEvent"] = 4] = "handleEvent";
|
---|
307 | })(DebugAction || (DebugAction = {}));
|
---|
308 | let _currentAction;
|
---|
309 | let _currentView;
|
---|
310 | let _currentNodeIndex;
|
---|
311 | function debugSetCurrentNode(view, nodeIndex) {
|
---|
312 | _currentView = view;
|
---|
313 | _currentNodeIndex = nodeIndex;
|
---|
314 | }
|
---|
315 | function debugHandleEvent(view, nodeIndex, eventName, event) {
|
---|
316 | debugSetCurrentNode(view, nodeIndex);
|
---|
317 | return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);
|
---|
318 | }
|
---|
319 | function debugUpdateDirectives(view, checkType) {
|
---|
320 | if (view.state & 128 /* Destroyed */) {
|
---|
321 | throw viewDestroyedError(DebugAction[_currentAction]);
|
---|
322 | }
|
---|
323 | debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));
|
---|
324 | return view.def.updateDirectives(debugCheckDirectivesFn, view);
|
---|
325 | function debugCheckDirectivesFn(view, nodeIndex, argStyle, ...values) {
|
---|
326 | const nodeDef = view.def.nodes[nodeIndex];
|
---|
327 | if (checkType === 0 /* CheckAndUpdate */) {
|
---|
328 | debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
|
---|
329 | }
|
---|
330 | else {
|
---|
331 | debugCheckNoChangesNode(view, nodeDef, argStyle, values);
|
---|
332 | }
|
---|
333 | if (nodeDef.flags & 16384 /* TypeDirective */) {
|
---|
334 | debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));
|
---|
335 | }
|
---|
336 | return (nodeDef.flags & 224 /* CatPureExpression */) ?
|
---|
337 | asPureExpressionData(view, nodeDef.nodeIndex).value :
|
---|
338 | undefined;
|
---|
339 | }
|
---|
340 | }
|
---|
341 | function debugUpdateRenderer(view, checkType) {
|
---|
342 | if (view.state & 128 /* Destroyed */) {
|
---|
343 | throw viewDestroyedError(DebugAction[_currentAction]);
|
---|
344 | }
|
---|
345 | debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));
|
---|
346 | return view.def.updateRenderer(debugCheckRenderNodeFn, view);
|
---|
347 | function debugCheckRenderNodeFn(view, nodeIndex, argStyle, ...values) {
|
---|
348 | const nodeDef = view.def.nodes[nodeIndex];
|
---|
349 | if (checkType === 0 /* CheckAndUpdate */) {
|
---|
350 | debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
|
---|
351 | }
|
---|
352 | else {
|
---|
353 | debugCheckNoChangesNode(view, nodeDef, argStyle, values);
|
---|
354 | }
|
---|
355 | if (nodeDef.flags & 3 /* CatRenderNode */) {
|
---|
356 | debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));
|
---|
357 | }
|
---|
358 | return (nodeDef.flags & 224 /* CatPureExpression */) ?
|
---|
359 | asPureExpressionData(view, nodeDef.nodeIndex).value :
|
---|
360 | undefined;
|
---|
361 | }
|
---|
362 | }
|
---|
363 | function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {
|
---|
364 | const changed = checkAndUpdateNode(view, nodeDef, argStyle, ...givenValues);
|
---|
365 | if (changed) {
|
---|
366 | const values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues;
|
---|
367 | if (nodeDef.flags & 16384 /* TypeDirective */) {
|
---|
368 | const bindingValues = {};
|
---|
369 | for (let i = 0; i < nodeDef.bindings.length; i++) {
|
---|
370 | const binding = nodeDef.bindings[i];
|
---|
371 | const value = values[i];
|
---|
372 | if (binding.flags & 8 /* TypeProperty */) {
|
---|
373 | bindingValues[normalizeDebugBindingName(binding.nonMinifiedName)] =
|
---|
374 | normalizeDebugBindingValue(value);
|
---|
375 | }
|
---|
376 | }
|
---|
377 | const elDef = nodeDef.parent;
|
---|
378 | const el = asElementData(view, elDef.nodeIndex).renderElement;
|
---|
379 | if (!elDef.element.name) {
|
---|
380 | // a comment.
|
---|
381 | view.renderer.setValue(el, escapeCommentText(`bindings=${JSON.stringify(bindingValues, null, 2)}`));
|
---|
382 | }
|
---|
383 | else {
|
---|
384 | // a regular element.
|
---|
385 | for (let attr in bindingValues) {
|
---|
386 | const value = bindingValues[attr];
|
---|
387 | if (value != null) {
|
---|
388 | view.renderer.setAttribute(el, attr, value);
|
---|
389 | }
|
---|
390 | else {
|
---|
391 | view.renderer.removeAttribute(el, attr);
|
---|
392 | }
|
---|
393 | }
|
---|
394 | }
|
---|
395 | }
|
---|
396 | }
|
---|
397 | }
|
---|
398 | function debugCheckNoChangesNode(view, nodeDef, argStyle, values) {
|
---|
399 | checkNoChangesNode(view, nodeDef, argStyle, ...values);
|
---|
400 | }
|
---|
401 | function nextDirectiveWithBinding(view, nodeIndex) {
|
---|
402 | for (let i = nodeIndex; i < view.def.nodes.length; i++) {
|
---|
403 | const nodeDef = view.def.nodes[i];
|
---|
404 | if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) {
|
---|
405 | return i;
|
---|
406 | }
|
---|
407 | }
|
---|
408 | return null;
|
---|
409 | }
|
---|
410 | function nextRenderNodeWithBinding(view, nodeIndex) {
|
---|
411 | for (let i = nodeIndex; i < view.def.nodes.length; i++) {
|
---|
412 | const nodeDef = view.def.nodes[i];
|
---|
413 | if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) {
|
---|
414 | return i;
|
---|
415 | }
|
---|
416 | }
|
---|
417 | return null;
|
---|
418 | }
|
---|
419 | class DebugContext_ {
|
---|
420 | constructor(view, nodeIndex) {
|
---|
421 | this.view = view;
|
---|
422 | this.nodeIndex = nodeIndex;
|
---|
423 | if (nodeIndex == null) {
|
---|
424 | this.nodeIndex = nodeIndex = 0;
|
---|
425 | }
|
---|
426 | this.nodeDef = view.def.nodes[nodeIndex];
|
---|
427 | let elDef = this.nodeDef;
|
---|
428 | let elView = view;
|
---|
429 | while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {
|
---|
430 | elDef = elDef.parent;
|
---|
431 | }
|
---|
432 | if (!elDef) {
|
---|
433 | while (!elDef && elView) {
|
---|
434 | elDef = viewParentEl(elView);
|
---|
435 | elView = elView.parent;
|
---|
436 | }
|
---|
437 | }
|
---|
438 | this.elDef = elDef;
|
---|
439 | this.elView = elView;
|
---|
440 | }
|
---|
441 | get elOrCompView() {
|
---|
442 | // Has to be done lazily as we use the DebugContext also during creation of elements...
|
---|
443 | return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;
|
---|
444 | }
|
---|
445 | get injector() {
|
---|
446 | return createInjector(this.elView, this.elDef);
|
---|
447 | }
|
---|
448 | get component() {
|
---|
449 | return this.elOrCompView.component;
|
---|
450 | }
|
---|
451 | get context() {
|
---|
452 | return this.elOrCompView.context;
|
---|
453 | }
|
---|
454 | get providerTokens() {
|
---|
455 | const tokens = [];
|
---|
456 | if (this.elDef) {
|
---|
457 | for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
|
---|
458 | const childDef = this.elView.def.nodes[i];
|
---|
459 | if (childDef.flags & 20224 /* CatProvider */) {
|
---|
460 | tokens.push(childDef.provider.token);
|
---|
461 | }
|
---|
462 | i += childDef.childCount;
|
---|
463 | }
|
---|
464 | }
|
---|
465 | return tokens;
|
---|
466 | }
|
---|
467 | get references() {
|
---|
468 | const references = {};
|
---|
469 | if (this.elDef) {
|
---|
470 | collectReferences(this.elView, this.elDef, references);
|
---|
471 | for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
|
---|
472 | const childDef = this.elView.def.nodes[i];
|
---|
473 | if (childDef.flags & 20224 /* CatProvider */) {
|
---|
474 | collectReferences(this.elView, childDef, references);
|
---|
475 | }
|
---|
476 | i += childDef.childCount;
|
---|
477 | }
|
---|
478 | }
|
---|
479 | return references;
|
---|
480 | }
|
---|
481 | get componentRenderElement() {
|
---|
482 | const elData = findHostElement(this.elOrCompView);
|
---|
483 | return elData ? elData.renderElement : undefined;
|
---|
484 | }
|
---|
485 | get renderNode() {
|
---|
486 | return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) :
|
---|
487 | renderNode(this.elView, this.elDef);
|
---|
488 | }
|
---|
489 | logError(console, ...values) {
|
---|
490 | let logViewDef;
|
---|
491 | let logNodeIndex;
|
---|
492 | if (this.nodeDef.flags & 2 /* TypeText */) {
|
---|
493 | logViewDef = this.view.def;
|
---|
494 | logNodeIndex = this.nodeDef.nodeIndex;
|
---|
495 | }
|
---|
496 | else {
|
---|
497 | logViewDef = this.elView.def;
|
---|
498 | logNodeIndex = this.elDef.nodeIndex;
|
---|
499 | }
|
---|
500 | // Note: we only generate a log function for text and element nodes
|
---|
501 | // to make the generated code as small as possible.
|
---|
502 | const renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);
|
---|
503 | let currRenderNodeIndex = -1;
|
---|
504 | let nodeLogger = () => {
|
---|
505 | currRenderNodeIndex++;
|
---|
506 | if (currRenderNodeIndex === renderNodeIndex) {
|
---|
507 | return console.error.bind(console, ...values);
|
---|
508 | }
|
---|
509 | else {
|
---|
510 | return NOOP;
|
---|
511 | }
|
---|
512 | };
|
---|
513 | logViewDef.factory(nodeLogger);
|
---|
514 | if (currRenderNodeIndex < renderNodeIndex) {
|
---|
515 | console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');
|
---|
516 | console.error(...values);
|
---|
517 | }
|
---|
518 | }
|
---|
519 | }
|
---|
520 | function getRenderNodeIndex(viewDef, nodeIndex) {
|
---|
521 | let renderNodeIndex = -1;
|
---|
522 | for (let i = 0; i <= nodeIndex; i++) {
|
---|
523 | const nodeDef = viewDef.nodes[i];
|
---|
524 | if (nodeDef.flags & 3 /* CatRenderNode */) {
|
---|
525 | renderNodeIndex++;
|
---|
526 | }
|
---|
527 | }
|
---|
528 | return renderNodeIndex;
|
---|
529 | }
|
---|
530 | function findHostElement(view) {
|
---|
531 | while (view && !isComponentView(view)) {
|
---|
532 | view = view.parent;
|
---|
533 | }
|
---|
534 | if (view.parent) {
|
---|
535 | return asElementData(view.parent, viewParentEl(view).nodeIndex);
|
---|
536 | }
|
---|
537 | return null;
|
---|
538 | }
|
---|
539 | function collectReferences(view, nodeDef, references) {
|
---|
540 | for (let refName in nodeDef.references) {
|
---|
541 | references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);
|
---|
542 | }
|
---|
543 | }
|
---|
544 | function callWithDebugContext(action, fn, self, args) {
|
---|
545 | const oldAction = _currentAction;
|
---|
546 | const oldView = _currentView;
|
---|
547 | const oldNodeIndex = _currentNodeIndex;
|
---|
548 | try {
|
---|
549 | _currentAction = action;
|
---|
550 | const result = fn.apply(self, args);
|
---|
551 | _currentView = oldView;
|
---|
552 | _currentNodeIndex = oldNodeIndex;
|
---|
553 | _currentAction = oldAction;
|
---|
554 | return result;
|
---|
555 | }
|
---|
556 | catch (e) {
|
---|
557 | if (isViewDebugError(e) || !_currentView) {
|
---|
558 | throw e;
|
---|
559 | }
|
---|
560 | throw viewWrappedDebugError(e, getCurrentDebugContext());
|
---|
561 | }
|
---|
562 | }
|
---|
563 | export function getCurrentDebugContext() {
|
---|
564 | return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;
|
---|
565 | }
|
---|
566 | export class DebugRendererFactory2 {
|
---|
567 | constructor(delegate) {
|
---|
568 | this.delegate = delegate;
|
---|
569 | }
|
---|
570 | createRenderer(element, renderData) {
|
---|
571 | return new DebugRenderer2(this.delegate.createRenderer(element, renderData));
|
---|
572 | }
|
---|
573 | begin() {
|
---|
574 | if (this.delegate.begin) {
|
---|
575 | this.delegate.begin();
|
---|
576 | }
|
---|
577 | }
|
---|
578 | end() {
|
---|
579 | if (this.delegate.end) {
|
---|
580 | this.delegate.end();
|
---|
581 | }
|
---|
582 | }
|
---|
583 | whenRenderingDone() {
|
---|
584 | if (this.delegate.whenRenderingDone) {
|
---|
585 | return this.delegate.whenRenderingDone();
|
---|
586 | }
|
---|
587 | return Promise.resolve(null);
|
---|
588 | }
|
---|
589 | }
|
---|
590 | export class DebugRenderer2 {
|
---|
591 | constructor(delegate) {
|
---|
592 | this.delegate = delegate;
|
---|
593 | /**
|
---|
594 | * Factory function used to create a `DebugContext` when a node is created.
|
---|
595 | *
|
---|
596 | * The `DebugContext` allows to retrieve information about the nodes that are useful in tests.
|
---|
597 | *
|
---|
598 | * The factory is configurable so that the `DebugRenderer2` could instantiate either a View Engine
|
---|
599 | * or a Render context.
|
---|
600 | */
|
---|
601 | this.debugContextFactory = getCurrentDebugContext;
|
---|
602 | this.data = this.delegate.data;
|
---|
603 | }
|
---|
604 | createDebugContext(nativeElement) {
|
---|
605 | return this.debugContextFactory(nativeElement);
|
---|
606 | }
|
---|
607 | destroyNode(node) {
|
---|
608 | const debugNode = getDebugNode(node);
|
---|
609 | if (debugNode) {
|
---|
610 | removeDebugNodeFromIndex(debugNode);
|
---|
611 | if (debugNode instanceof DebugNode__PRE_R3__) {
|
---|
612 | debugNode.listeners.length = 0;
|
---|
613 | }
|
---|
614 | }
|
---|
615 | if (this.delegate.destroyNode) {
|
---|
616 | this.delegate.destroyNode(node);
|
---|
617 | }
|
---|
618 | }
|
---|
619 | destroy() {
|
---|
620 | this.delegate.destroy();
|
---|
621 | }
|
---|
622 | createElement(name, namespace) {
|
---|
623 | const el = this.delegate.createElement(name, namespace);
|
---|
624 | const debugCtx = this.createDebugContext(el);
|
---|
625 | if (debugCtx) {
|
---|
626 | const debugEl = new DebugElement__PRE_R3__(el, null, debugCtx);
|
---|
627 | debugEl.name = name;
|
---|
628 | indexDebugNode(debugEl);
|
---|
629 | }
|
---|
630 | return el;
|
---|
631 | }
|
---|
632 | createComment(value) {
|
---|
633 | const comment = this.delegate.createComment(escapeCommentText(value));
|
---|
634 | const debugCtx = this.createDebugContext(comment);
|
---|
635 | if (debugCtx) {
|
---|
636 | indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));
|
---|
637 | }
|
---|
638 | return comment;
|
---|
639 | }
|
---|
640 | createText(value) {
|
---|
641 | const text = this.delegate.createText(value);
|
---|
642 | const debugCtx = this.createDebugContext(text);
|
---|
643 | if (debugCtx) {
|
---|
644 | indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx));
|
---|
645 | }
|
---|
646 | return text;
|
---|
647 | }
|
---|
648 | appendChild(parent, newChild) {
|
---|
649 | const debugEl = getDebugNode(parent);
|
---|
650 | const debugChildEl = getDebugNode(newChild);
|
---|
651 | if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
652 | debugEl.addChild(debugChildEl);
|
---|
653 | }
|
---|
654 | this.delegate.appendChild(parent, newChild);
|
---|
655 | }
|
---|
656 | insertBefore(parent, newChild, refChild, isMove) {
|
---|
657 | const debugEl = getDebugNode(parent);
|
---|
658 | const debugChildEl = getDebugNode(newChild);
|
---|
659 | const debugRefEl = getDebugNode(refChild);
|
---|
660 | if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
661 | debugEl.insertBefore(debugRefEl, debugChildEl);
|
---|
662 | }
|
---|
663 | this.delegate.insertBefore(parent, newChild, refChild, isMove);
|
---|
664 | }
|
---|
665 | removeChild(parent, oldChild) {
|
---|
666 | const debugEl = getDebugNode(parent);
|
---|
667 | const debugChildEl = getDebugNode(oldChild);
|
---|
668 | if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
669 | debugEl.removeChild(debugChildEl);
|
---|
670 | }
|
---|
671 | this.delegate.removeChild(parent, oldChild);
|
---|
672 | }
|
---|
673 | selectRootElement(selectorOrNode, preserveContent) {
|
---|
674 | const el = this.delegate.selectRootElement(selectorOrNode, preserveContent);
|
---|
675 | const debugCtx = getCurrentDebugContext();
|
---|
676 | if (debugCtx) {
|
---|
677 | indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx));
|
---|
678 | }
|
---|
679 | return el;
|
---|
680 | }
|
---|
681 | setAttribute(el, name, value, namespace) {
|
---|
682 | const debugEl = getDebugNode(el);
|
---|
683 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
684 | const fullName = namespace ? namespace + ':' + name : name;
|
---|
685 | debugEl.attributes[fullName] = value;
|
---|
686 | }
|
---|
687 | this.delegate.setAttribute(el, name, value, namespace);
|
---|
688 | }
|
---|
689 | removeAttribute(el, name, namespace) {
|
---|
690 | const debugEl = getDebugNode(el);
|
---|
691 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
692 | const fullName = namespace ? namespace + ':' + name : name;
|
---|
693 | debugEl.attributes[fullName] = null;
|
---|
694 | }
|
---|
695 | this.delegate.removeAttribute(el, name, namespace);
|
---|
696 | }
|
---|
697 | addClass(el, name) {
|
---|
698 | const debugEl = getDebugNode(el);
|
---|
699 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
700 | debugEl.classes[name] = true;
|
---|
701 | }
|
---|
702 | this.delegate.addClass(el, name);
|
---|
703 | }
|
---|
704 | removeClass(el, name) {
|
---|
705 | const debugEl = getDebugNode(el);
|
---|
706 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
707 | debugEl.classes[name] = false;
|
---|
708 | }
|
---|
709 | this.delegate.removeClass(el, name);
|
---|
710 | }
|
---|
711 | setStyle(el, style, value, flags) {
|
---|
712 | const debugEl = getDebugNode(el);
|
---|
713 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
714 | debugEl.styles[style] = value;
|
---|
715 | }
|
---|
716 | this.delegate.setStyle(el, style, value, flags);
|
---|
717 | }
|
---|
718 | removeStyle(el, style, flags) {
|
---|
719 | const debugEl = getDebugNode(el);
|
---|
720 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
721 | debugEl.styles[style] = null;
|
---|
722 | }
|
---|
723 | this.delegate.removeStyle(el, style, flags);
|
---|
724 | }
|
---|
725 | setProperty(el, name, value) {
|
---|
726 | const debugEl = getDebugNode(el);
|
---|
727 | if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
|
---|
728 | debugEl.properties[name] = value;
|
---|
729 | }
|
---|
730 | this.delegate.setProperty(el, name, value);
|
---|
731 | }
|
---|
732 | listen(target, eventName, callback) {
|
---|
733 | if (typeof target !== 'string') {
|
---|
734 | const debugEl = getDebugNode(target);
|
---|
735 | if (debugEl) {
|
---|
736 | debugEl.listeners.push(new DebugEventListener(eventName, callback));
|
---|
737 | }
|
---|
738 | }
|
---|
739 | return this.delegate.listen(target, eventName, callback);
|
---|
740 | }
|
---|
741 | parentNode(node) {
|
---|
742 | return this.delegate.parentNode(node);
|
---|
743 | }
|
---|
744 | nextSibling(node) {
|
---|
745 | return this.delegate.nextSibling(node);
|
---|
746 | }
|
---|
747 | setValue(node, value) {
|
---|
748 | return this.delegate.setValue(node, value);
|
---|
749 | }
|
---|
750 | }
|
---|
751 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy92aWV3L3NlcnZpY2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxzQkFBc0IsRUFBRSxrQkFBa0IsRUFBRSxtQkFBbUIsRUFBRSxZQUFZLEVBQUUsY0FBYyxFQUFFLHdCQUF3QixFQUFDLE1BQU0scUJBQXFCLENBQUM7QUFDNUosT0FBTyxFQUFXLGlCQUFpQixFQUFDLE1BQU0sT0FBTyxDQUFDO0FBQ2xELE9BQU8sRUFBQyxnQkFBZ0IsRUFBMEMsTUFBTSxzQkFBc0IsQ0FBQztBQUMvRixPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFJOUMsT0FBTyxFQUFZLGdCQUFnQixFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRTFELE9BQU8sRUFBQyxTQUFTLEVBQUMsTUFBTSwyQkFBMkIsQ0FBQztBQUNwRCxPQUFPLEVBQUMsaUJBQWlCLEVBQUMsTUFBTSxhQUFhLENBQUM7QUFDOUMsT0FBTyxFQUFDLFNBQVMsRUFBQyxNQUFNLHFCQUFxQixDQUFDO0FBQzlDLE9BQU8sRUFBQyx5QkFBeUIsRUFBRSwwQkFBMEIsRUFBQyxNQUFNLG9CQUFvQixDQUFDO0FBRXpGLE9BQU8sRUFBQyxnQkFBZ0IsRUFBRSxrQkFB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