Exemple #1
0
  constructor(instance: HelperInstance, args: CapturedArguments) {
    super();

    this.tag = combine([instance[RECOMPUTE_TAG], args.tag]);
    this.instance = instance;
    this.args = args;
  }
Exemple #2
0
  constructor(ref: UpdatableReference, keyFor: (value: any, memo: any) => any) {
    this.ref = ref;
    this.keyFor = keyFor;

    let valueTag = this.valueTag = UpdatableTag.create(CONSTANT_TAG);

    this.tag = combine([ref.tag, valueTag]);
  }
Exemple #3
0
  constructor(parentReference: VersionedPathReference<Opaque>, propertyKey: string) {
    super();

    let parentReferenceTag = parentReference.tag;
    let propertyTag = UpdatableTag.create(CONSTANT_TAG);

    this._parentReference = parentReference;
    this._propertyTag = propertyTag;
    this._propertyKey = propertyKey;

    if (DEBUG) {
      let tag = combine([parentReferenceTag, propertyTag]);
      this.tag = TwoWayFlushDetectionTag.create(tag, propertyKey, this);
    } else {
      this.tag = combine([parentReferenceTag, propertyTag]);
    }
  }
Exemple #4
0
  constructor(parentReference: any, propertyKey: string) {
    super();

    let parentReferenceTag = parentReference.tag;
    let parentObjectTag = UpdatableTag.create(CONSTANT_TAG);

    this._parentReference = parentReference;
    this._parentObjectTag = parentObjectTag;
    this._propertyKey = propertyKey;

    if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) {
      let tag = combine([parentReferenceTag, parentObjectTag]);
      this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this);
    } else {
      this.tag = combine([parentReferenceTag, parentObjectTag]);
    }
  }
Exemple #5
0
  constructor(ref: any, keyFor: ((iterable: any) => any) | ((item: any, i: any) => string)) {
    this.ref = ref;
    this.keyFor = keyFor;

    let valueTag = this.valueTag = UpdatableTag.create(CONSTANT_TAG);

    this.tag = combine([ref.tag, valueTag]);
  }
Exemple #6
0
 constructor(outletNameRef: any, parentOutletStateRef: any) {
   this.outletNameRef = outletNameRef;
   this.parentOutletStateRef = parentOutletStateRef;
   this.definition = null;
   this.lastState = null;
   let outletStateTag = this.outletStateTag = UpdatableTag.create(parentOutletStateRef.tag);
   this.tag = combine([outletStateTag.inner, outletNameRef.tag]);
 }
Exemple #7
0
export function getChainTagsForKeys(obj: any, keys: string[]) {
  let chainTags: Tag[] = [];

  for (let i = 0; i < keys.length; i++) {
    chainTags.push(getChainTagsForKey(obj, keys[i]));
  }

  return combine(chainTags);
}
Exemple #8
0
  constructor(cond: any, truthy: any, falsy: any) {
    super();

    this.branchTag = UpdatableTag.create(CONSTANT_TAG);
    this.tag = combine([cond.tag, this.branchTag]);

    this.cond = cond;
    this.truthy = truthy;
    this.falsy = falsy;
  }
Exemple #9
0
  constructor(sourceReference: VersionedPathReference<Opaque>, pathReference: PathReference<string>) {
    super();
    this.sourceReference = sourceReference;
    this.pathReference = pathReference;

    this.lastPath = null;
    this.innerReference = NULL_REFERENCE;

    let innerTag = this.innerTag = UpdatableTag.create(CONSTANT_TAG);

    this.tag = combine([sourceReference.tag, pathReference.tag, innerTag]);
  }
Exemple #10
0
export function tagForProperty(object: any, propertyKey: string | symbol, _meta?: Meta): Tag {
  if (typeof object !== 'object' || object === null) {
    return CONSTANT_TAG;
  }
  let meta = _meta === undefined ? metaFor(object) : _meta;

  if (isProxy(object)) {
    return tagFor(object, meta);
  }

  let tags = meta.writableTags();
  let tag = tags[propertyKey];
  if (tag) {
    return tag;
  }

  if (EMBER_METAL_TRACKED_PROPERTIES) {
    let pair = combine([makeTag(), UpdatableTag.create(CONSTANT_TAG)]);
    return (tags[propertyKey] = pair);
  } else {
    return (tags[propertyKey] = makeTag());
  }
}