Skip to content

Commit f8e31f3

Browse files
committed
isSimple -> isEmpty
1 parent 61e4dd1 commit f8e31f3

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ CompilerProto.bindDirective = function (directive) {
391391

392392
// for a simple directive, simply call its bind() or _update()
393393
// and we're done.
394-
if (directive.isSimple) {
394+
if (directive.isEmpty) {
395395
if (directive.bind) directive.bind()
396396
return
397397
}
@@ -605,7 +605,7 @@ CompilerProto.destroy = function () {
605605
// if this directive is an instance of an external binding
606606
// e.g. a directive that refers to a variable on the parent VM
607607
// we need to remove it from that binding's instances
608-
if (!dir.isSimple && dir.binding.compiler !== compiler) {
608+
if (!dir.isEmpty && dir.binding.compiler !== compiler) {
609609
instances = dir.binding.instances
610610
if (instances) instances.splice(instances.indexOf(dir), 1)
611611
}

src/directive.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ function Directive (definition, expression, rawKey, compiler, node) {
2727
this.vm = compiler.vm
2828
this.el = node
2929

30-
var isSimple = expression === ''
30+
var isEmpty = expression === ''
3131

3232
// mix in properties from the directive definition
3333
if (typeof definition === 'function') {
34-
this[isSimple ? 'bind' : '_update'] = definition
34+
this[isEmpty ? 'bind' : '_update'] = definition
3535
} else {
3636
for (var prop in definition) {
3737
if (prop === 'unbind' || prop === 'update') {
@@ -43,8 +43,8 @@ function Directive (definition, expression, rawKey, compiler, node) {
4343
}
4444

4545
// empty expression, we're done.
46-
if (isSimple) {
47-
this.isSimple = true
46+
if (isEmpty) {
47+
this.isEmpty = true
4848
return
4949
}
5050

src/directives/with.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var ViewModel
33
module.exports = {
44

55
bind: function () {
6-
if (this.isSimple) {
6+
if (this.isEmpty) {
77
this.build()
88
}
99
},

test/unit/specs/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('UNIT: Directive', function () {
102102
it('should return a simple Directive if expression is empty', function () {
103103
var d = Directive.parse('text', '', compiler)
104104
assert.ok(d instanceof Directive)
105-
assert.ok(d.isSimple)
105+
assert.ok(d.isEmpty)
106106
})
107107

108108
it('should return an instance of Directive if args are good', function () {

0 commit comments

Comments
 (0)