Skip to content

Commit

Permalink
update isConst -> isConstTagged
Browse files Browse the repository at this point in the history
(cherry picked from commit 7353892)
  • Loading branch information
Chris Garrett authored and kategengler committed May 26, 2020
1 parent cddf387 commit 047f1b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -17,7 +17,7 @@ import {
} from '@glimmer/interfaces';
import { ComponentRootReference, PathReference } from '@glimmer/reference';
import { unwrapTemplate } from '@glimmer/util';
import { consumeTag, createTag, isConst, Tag } from '@glimmer/validator';
import { consumeTag, createTag, isConstTagged, Tag } from '@glimmer/validator';

import { ENV } from '@ember/-internals/environment';
import { EmberVMEnvironment } from '../environment';
Expand Down Expand Up @@ -370,7 +370,7 @@ export default class CustomComponentManager<ComponentInstance>
}

getTag({ args }: CustomComponentState<ComponentInstance>): Tag {
if (isConst(args)) {
if (isConstTagged(args)) {
// returning a const tag skips the update hook (VM BUG?)
return createTag();
} else {
Expand Down
Expand Up @@ -12,7 +12,7 @@ import {
VMArguments,
} from '@glimmer/interfaces';
import { ComponentRootReference, ConstReference, VersionedPathReference } from '@glimmer/reference';
import { CONSTANT_TAG, createTag, isConst } from '@glimmer/validator';
import { CONSTANT_TAG, createTag, isConstTagged } from '@glimmer/validator';
import { EmberVMEnvironment } from '../environment';
import InternalComponentManager, { InternalDefinitionState } from './internal';

Expand Down Expand Up @@ -70,7 +70,7 @@ export default class InputComponentManager extends InternalComponentManager<Inpu
_dynamicScope: DynamicScope,
caller: VersionedPathReference
): InputComponentState {
assert('caller must be const', isConst(caller));
assert('caller must be const', isConstTagged(caller));

let type = args.named.get('type');

Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/glimmer/lib/helpers/action.ts
Expand Up @@ -9,7 +9,7 @@ import { join } from '@ember/runloop';
import { DEBUG } from '@glimmer/env';
import { VM, VMArguments } from '@glimmer/interfaces';
import { VersionedPathReference } from '@glimmer/reference';
import { isConst } from '@glimmer/validator';
import { isConstTagged } from '@glimmer/validator';
import { UnboundRootReference } from '../utils/references';
import { INVOKE } from './mut';

Expand Down Expand Up @@ -299,7 +299,7 @@ export default function(args: VMArguments, vm: VM): UnboundRootReference<Functio

if (typeof action[INVOKE] === 'function') {
fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey);
} else if (isConst(target) && isConst(action)) {
} else if (isConstTagged(target) && isConstTagged(action)) {
fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey);
} else {
fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey);
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/glimmer/lib/helpers/get.ts
Expand Up @@ -7,7 +7,7 @@ import {
VersionedPathReference,
} from '@glimmer/reference';
import { NULL_REFERENCE } from '@glimmer/runtime';
import { isConst } from '@glimmer/validator';
import { isConstTagged } from '@glimmer/validator';
import { referenceFromParts } from '../utils/references';

/**
Expand Down Expand Up @@ -98,7 +98,7 @@ export default function(args: VMArguments, vm: VM) {
let sourceReference = args.positional.at(0);
let pathReference = args.positional.at(1);

if (isConst(pathReference)) {
if (isConstTagged(pathReference)) {
// Since the path is constant, we can create a normal chain of property
// references. The source reference will update like normal, and all of the
// child references will update accordingly.
Expand Down

0 comments on commit 047f1b5

Please sign in to comment.