Skip to content

Commit

Permalink
Removed useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yadav committed Nov 8, 2019
1 parent a182b6b commit 4a39573
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
53 changes: 0 additions & 53 deletions src/brahmosNode.js
Expand Up @@ -66,56 +66,3 @@ export function link (parent, children) {

parent.child = lastChild;
}

export function haveRelation (node, parent) {
while (node) {
node = node.parent;
if (node === parent) return true;
}

return false;
}

export function linkComponentNode (node) {
const { children } = node.props;
}

export function processTagNode (node) {
const { templateNode, oldValues, values } = node;
const { parts } = templateNode;
for (let i = 0, ln = values.length; i < ln; i++) {
const value = values[i];
const oldValue = oldValues[i];
let part = parts[i];

const { isAttribute, isNode } = part;

if (isAttribute) {
const { domNode } = part;

// mix all the consecutive attributes if they belong to same domNode
const dynamicAttributes = {};
while (part && domNode === part.domNode) {
Object.entries(values[i]).forEach(([attrName, attrValue]) => {
const overrideAttrNameCheck = MODIFIED_ATTRIBUTES[attrName];
const isOverridden = isAttrOverridden(part.tagAttrs, overrideAttrNameCheck, part.attrIndex);
if (!isOverridden && !RESERVED_ATTRIBUTES[attrName]) {
dynamicAttributes[attrName] = attrValue;
} else if (attrName === 'ref') {
// Note only functional refs are supported
setRef(attrValue, domNode);
}
});
part = parts[++i];
}

// reduce the counter to correct the loop index. As it is extra incremented in while loop
i--;

const oldDynamicAttributes = domNode.__dynamicAttributes || {};

// store the dynamic attribute reference on domNode so it can be used on next render
domNode.__dynamicAttributes = dynamicAttributes;
}
}
}
2 changes: 1 addition & 1 deletion src/updater.js
Expand Up @@ -25,7 +25,7 @@ export default function updater (parts, values, oldValues, context, forceUpdate,

// mix all the consecutive attributes if they belong to same domNode
const dynamicAttributes = {};
while (part && node === part.node) {
while (part && domNode === part.domNode) {
loopEntries(values[i], (attrName, attrValue) => {
const overrideAttrNameCheck = MODIFIED_ATTRIBUTES[attrName];
const isOverridden = isAttrOverridden(part.tagAttrs, overrideAttrNameCheck, part.attrIndex);
Expand Down

0 comments on commit 4a39573

Please sign in to comment.