Skip to content

Commit

Permalink
opti: remove isComponent variable
Browse files Browse the repository at this point in the history
  • Loading branch information
errorrik committed May 23, 2019
1 parent 099ea4c commit ec49201
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/view/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ Component.prototype._attach = function (parentEl, beforeEl) {

if (!ifDirective || evalExpr(ifDirective.value, this.data, this)) {
if (!this.el) {
var isComponent = this.nodeType === NodeType.CMPT;
var sourceNode = this.aNode.hotspot.sourceNode;
var props = this.aNode.props;

Expand All @@ -858,13 +857,10 @@ Component.prototype._attach = function (parentEl, beforeEl) {

for (var i = 0, l = props.length; i < l; i++) {
var prop = props[i];
var propName = prop.name;
var value = isComponent
? evalExpr(prop.expr, this.data, this)
: evalExpr(prop.expr, this.scope, this.owner);
var value = evalExpr(prop.expr, this.data, this);

if (value || !baseProps[propName]) {
prop.handler(this.el, value, propName, this, prop);
if (value || !baseProps[prop.name]) {
prop.handler(this.el, value, prop.name, this, prop);
}
}

Expand Down

0 comments on commit ec49201

Please sign in to comment.