Comparing version 0.8.0 to 0.8.1
{ | ||
"name": "vue", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"author": { | ||
@@ -33,3 +33,3 @@ "name": "Evan You", | ||
"gulp-component": "~0.1.4", | ||
"vinyl-fs": "git://github.com/wearefractal/vinyl-fs", | ||
"vinyl-fs": "~0.0.2", | ||
"jshint-stylish": "~0.1.4", | ||
@@ -36,0 +36,0 @@ "semver": "~2.2.1", |
@@ -520,6 +520,3 @@ var Emitter = require('./emitter'), | ||
if (getter) { | ||
var value = binding.isFn | ||
? getter | ||
: { $get: getter } | ||
this.markComputed(binding, value) | ||
this.markComputed(binding, getter) | ||
this.exps.push(binding) | ||
@@ -535,7 +532,5 @@ } | ||
var def = { | ||
get: binding.value.$get | ||
get: binding.value.$get, | ||
set: binding.value.$set | ||
} | ||
if (binding.value.$set) { | ||
def.set = binding.value.$set | ||
} | ||
Object.defineProperty(this.vm, key, def) | ||
@@ -549,12 +544,16 @@ } | ||
CompilerProto.markComputed = function (binding, value) { | ||
binding.value = value | ||
binding.isComputed = true | ||
// bind the accessors to the vm | ||
if (!binding.isFn) { | ||
if (binding.isFn) { | ||
binding.value = value | ||
} else { | ||
if (typeof value === 'function') { | ||
value = { $get: value } | ||
} | ||
binding.value = { | ||
$get: utils.bind(value.$get, this.vm) | ||
$get: utils.bind(value.$get, this.vm), | ||
$set: value.$set | ||
? utils.bind(value.$set, this.vm) | ||
: undefined | ||
} | ||
if (value.$set) { | ||
binding.value.$set = utils.bind(value.$set, this.vm) | ||
} | ||
} | ||
@@ -561,0 +560,0 @@ // keep track for dep parsing later |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1489970
2658