MCPcopy
hub / github.com/CesiumGS/cesium / resolve

Function resolve

packages/engine/Source/DataSources/ReferenceProperty.js:7–46  ·  view source on GitHub ↗
(that)

Source from the content-addressed store, hash-verified

5import Property from "./Property.js";
6
7function resolve(that) {
8 let targetProperty = that._targetProperty;
9
10 if (!defined(targetProperty)) {
11 let targetEntity = that._targetEntity;
12
13 if (!defined(targetEntity)) {
14 targetEntity = that._targetCollection.getById(that._targetId);
15
16 if (!defined(targetEntity)) {
17 // target entity not found
18 that._targetEntity = that._targetProperty = undefined;
19 return;
20 }
21
22 // target entity was found. listen for changes to entity definition
23 targetEntity.definitionChanged.addEventListener(
24 ReferenceProperty.prototype._onTargetEntityDefinitionChanged,
25 that,
26 );
27 that._targetEntity = targetEntity;
28 }
29
30 // walk the list of property names and resolve properties
31 const targetPropertyNames = that._targetPropertyNames;
32 targetProperty = that._targetEntity;
33 for (
34 let i = 0, len = targetPropertyNames.length;
35 i < len && defined(targetProperty);
36 ++i
37 ) {
38 targetProperty = targetProperty[targetPropertyNames[i]];
39 }
40
41 // target property may or may not be defined, depending on if it was found
42 that._targetProperty = targetProperty;
43 }
44
45 return targetProperty;
46}
47
48/**
49 * A {@link Property} which transparently links to another property on a provided object.

Callers 15

gulpfile.jsFile · 0.85
clocSourceFunction · 0.85
runCoverageFunction · 0.85
testFunction · 0.85
throttleFunction · 0.85
waitForSignal0Function · 0.85
TextureAtlas.jsFile · 0.85
getBinaryPromiseFunction · 0.85
MostDetailedRayPickFunction · 0.85
exportKml.jsFile · 0.85
readBlobAsTextFunction · 0.85

Calls 2

addEventListenerMethod · 0.80
definedFunction · 0.50

Tested by 1

testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…