Skip to content

Commit

Permalink
rename isNode to isANode
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Feb 5, 2025
1 parent b9e4838 commit ffc72d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/core/a-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export var knownTags = {
'a-entity': true
};

function isNode (node) {
return node.tagName.toLowerCase() in knownTags || node.isNode;
function isANode (node) {
return node.tagName.toLowerCase() in knownTags || node.isANode;
}

/**
Expand All @@ -29,7 +29,7 @@ export class ANode extends HTMLElement {
super();
this.computedMixinStr = '';
this.hasLoaded = false;
this.isNode = true;
this.isANode = true;
this.mixinEls = [];
}

Expand Down Expand Up @@ -119,7 +119,7 @@ export class ANode extends HTMLElement {
if (this.hasLoaded) { return; }

// Default to waiting for all nodes.
childFilter = childFilter || isNode;
childFilter = childFilter || isANode;
// Wait for children to load (if any), then load.
children = this.getChildren();
childrenLoaded = children.filter(childFilter).map(function (child) {
Expand Down
2 changes: 1 addition & 1 deletion src/systems/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export var System = registerSystem('camera', {
});

// Load camera and wait for camera to initialize.
if (cameraEls[i].isNode) {
if (cameraEls[i].isANode) {
cameraEls[i].load();
} else {
cameraEls[i].addEventListener('nodeready', function () {
Expand Down
10 changes: 5 additions & 5 deletions tests/core/a-entity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ suite('a-entity', function () {
});

test('createdCallback', function () {
assert.ok(el.isNode);
assert.ok(el.isANode);
assert.ok(el.isEntity);
});

Expand Down Expand Up @@ -669,9 +669,9 @@ suite('a-entity', function () {
el.appendChild(a);
el.appendChild(b);
setTimeout(function () {
a.isNode = false;
a.isANode = false;
a.hasLoaded = false;
b.isNode = false;
b.isANode = false;
b.hasLoaded = false;
el.hasLoaded = false;
el.addEventListener('loaded', function () {
Expand All @@ -697,9 +697,9 @@ suite('a-entity', function () {
el.appendChild(a);
el.appendChild(b);
setTimeout(function () {
a.isNode = false;
a.isANode = false;
a.hasLoaded = false;
b.isNode = false;
b.isANode = false;
b.hasLoaded = false;
el.hasLoaded = false;
el.addEventListener('loaded', function () {
Expand Down

0 comments on commit ffc72d0

Please sign in to comment.