Skip to content

Commit

Permalink
chore(all): prepare release 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Oct 5, 2016
1 parent 0358dc3 commit 8bafaf8
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-binding",
"version": "1.0.6",
"version": "1.0.7",
"description": "A modern databinding library for JavaScript and HTML.",
"license": "MIT",
"keywords": [
Expand Down
15 changes: 13 additions & 2 deletions dist/amd/aurelia-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3692,7 +3692,7 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aure
StyleObserver.prototype._setProperty = function _setProperty(style, value) {
var priority = '';

if (value.indexOf('!important') !== -1) {
if (value.indexOf && value.indexOf('!important') !== -1) {
priority = 'important';
value = value.replace('!important', '');
}
Expand Down Expand Up @@ -5312,12 +5312,17 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aure
}

var innerPropertyName = '_' + key;
var innerPropertyDescriptor = {
configurable: true,
enumerable: false,
writable: true
};

var callbackName = config && config.changeHandler || key + 'Changed';

if (descriptor) {
if (typeof descriptor.initializer === 'function') {
target[innerPropertyName] = descriptor.initializer();
innerPropertyDescriptor.value = descriptor.initializer();
}
} else {
descriptor = {};
Expand All @@ -5327,15 +5332,21 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aure
descriptor.enumerable = true;
}

delete descriptor.value;
delete descriptor.writable;
delete descriptor.initializer;

Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);

descriptor.get = function () {
return this[innerPropertyName];
};
descriptor.set = function (newValue) {
var oldValue = this[innerPropertyName];

this[innerPropertyName] = newValue;
Reflect.defineProperty(this, innerPropertyName, { enumerable: false });

if (this[callbackName]) {
this[callbackName](newValue, oldValue, key);
}
Expand Down
17 changes: 15 additions & 2 deletions dist/aurelia-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,7 @@ export class StyleObserver {
_setProperty(style, value) {
let priority = '';

if (value.indexOf('!important') !== -1) {
if (value.indexOf && value.indexOf('!important') !== -1) {
priority = 'important';
value = value.replace('!important', '');
}
Expand Down Expand Up @@ -5040,6 +5040,11 @@ export function observable(targetOrConfig: any, key: string, descriptor?: Proper

// use a convention to compute the inner property name
let innerPropertyName = `_${key}`;
const innerPropertyDescriptor: PropertyDescriptor = {
configurable: true,
enumerable: false,
writable: true
};

// determine callback name based on config or convention.
const callbackName = (config && config.changeHandler) || `${key}Changed`;
Expand All @@ -5049,7 +5054,7 @@ export function observable(targetOrConfig: any, key: string, descriptor?: Proper

// set the initial value of the property if it is defined.
if (typeof descriptor.initializer === 'function') {
target[innerPropertyName] = descriptor.initializer();
innerPropertyDescriptor.value = descriptor.initializer();
}
} else {
// there is no descriptor if the target was a field in TS (although Babel provides one),
Expand All @@ -5063,14 +5068,22 @@ export function observable(targetOrConfig: any, key: string, descriptor?: Proper

// we're adding a getter and setter which means the property descriptor
// cannot have a "value" or "writable" attribute
delete descriptor.value;
delete descriptor.writable;
delete descriptor.initializer;

// Add the inner property on the prototype.
Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);

// add the getter and setter to the property descriptor.
descriptor.get = function() { return this[innerPropertyName]; };
descriptor.set = function(newValue) {
let oldValue = this[innerPropertyName];

// Add the inner property on the instance and make it nonenumerable.
this[innerPropertyName] = newValue;
Reflect.defineProperty(this, innerPropertyName, { enumerable: false });

if (this[callbackName]) {
this[callbackName](newValue, oldValue, key);
}
Expand Down
15 changes: 13 additions & 2 deletions dist/commonjs/aurelia-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3645,7 +3645,7 @@ var StyleObserver = exports.StyleObserver = function () {
StyleObserver.prototype._setProperty = function _setProperty(style, value) {
var priority = '';

if (value.indexOf('!important') !== -1) {
if (value.indexOf && value.indexOf('!important') !== -1) {
priority = 'important';
value = value.replace('!important', '');
}
Expand Down Expand Up @@ -5265,12 +5265,17 @@ function observable(targetOrConfig, key, descriptor) {
}

var innerPropertyName = '_' + key;
var innerPropertyDescriptor = {
configurable: true,
enumerable: false,
writable: true
};

var callbackName = config && config.changeHandler || key + 'Changed';

if (descriptor) {
if (typeof descriptor.initializer === 'function') {
target[innerPropertyName] = descriptor.initializer();
innerPropertyDescriptor.value = descriptor.initializer();
}
} else {
descriptor = {};
Expand All @@ -5280,15 +5285,21 @@ function observable(targetOrConfig, key, descriptor) {
descriptor.enumerable = true;
}

delete descriptor.value;
delete descriptor.writable;
delete descriptor.initializer;

Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);

descriptor.get = function () {
return this[innerPropertyName];
};
descriptor.set = function (newValue) {
var oldValue = this[innerPropertyName];

this[innerPropertyName] = newValue;
Reflect.defineProperty(this, innerPropertyName, { enumerable: false });

if (this[callbackName]) {
this[callbackName](newValue, oldValue, key);
}
Expand Down
15 changes: 13 additions & 2 deletions dist/es2015/aurelia-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@ export let StyleObserver = class StyleObserver {
_setProperty(style, value) {
let priority = '';

if (value.indexOf('!important') !== -1) {
if (value.indexOf && value.indexOf('!important') !== -1) {
priority = 'important';
value = value.replace('!important', '');
}
Expand Down Expand Up @@ -4806,12 +4806,17 @@ export function observable(targetOrConfig, key, descriptor) {
}

let innerPropertyName = `_${ key }`;
const innerPropertyDescriptor = {
configurable: true,
enumerable: false,
writable: true
};

const callbackName = config && config.changeHandler || `${ key }Changed`;

if (descriptor) {
if (typeof descriptor.initializer === 'function') {
target[innerPropertyName] = descriptor.initializer();
innerPropertyDescriptor.value = descriptor.initializer();
}
} else {
descriptor = {};
Expand All @@ -4821,15 +4826,21 @@ export function observable(targetOrConfig, key, descriptor) {
descriptor.enumerable = true;
}

delete descriptor.value;
delete descriptor.writable;
delete descriptor.initializer;

Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);

descriptor.get = function () {
return this[innerPropertyName];
};
descriptor.set = function (newValue) {
let oldValue = this[innerPropertyName];

this[innerPropertyName] = newValue;
Reflect.defineProperty(this, innerPropertyName, { enumerable: false });

if (this[callbackName]) {
this[callbackName](newValue, oldValue, key);
}
Expand Down
15 changes: 13 additions & 2 deletions dist/native-modules/aurelia-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3610,7 +3610,7 @@ export var StyleObserver = function () {
StyleObserver.prototype._setProperty = function _setProperty(style, value) {
var priority = '';

if (value.indexOf('!important') !== -1) {
if (value.indexOf && value.indexOf('!important') !== -1) {
priority = 'important';
value = value.replace('!important', '');
}
Expand Down Expand Up @@ -5227,12 +5227,17 @@ export function observable(targetOrConfig, key, descriptor) {
}

var innerPropertyName = '_' + key;
var innerPropertyDescriptor = {
configurable: true,
enumerable: false,
writable: true
};

var callbackName = config && config.changeHandler || key + 'Changed';

if (descriptor) {
if (typeof descriptor.initializer === 'function') {
target[innerPropertyName] = descriptor.initializer();
innerPropertyDescriptor.value = descriptor.initializer();
}
} else {
descriptor = {};
Expand All @@ -5242,15 +5247,21 @@ export function observable(targetOrConfig, key, descriptor) {
descriptor.enumerable = true;
}

delete descriptor.value;
delete descriptor.writable;
delete descriptor.initializer;

Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);

descriptor.get = function () {
return this[innerPropertyName];
};
descriptor.set = function (newValue) {
var oldValue = this[innerPropertyName];

this[innerPropertyName] = newValue;
Reflect.defineProperty(this, innerPropertyName, { enumerable: false });

if (this[callbackName]) {
this[callbackName](newValue, oldValue, key);
}
Expand Down
15 changes: 13 additions & 2 deletions dist/system/aurelia-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,17 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aureli
}

var innerPropertyName = '_' + key;
var innerPropertyDescriptor = {
configurable: true,
enumerable: false,
writable: true
};

var callbackName = config && config.changeHandler || key + 'Changed';

if (descriptor) {
if (typeof descriptor.initializer === 'function') {
target[innerPropertyName] = descriptor.initializer();
innerPropertyDescriptor.value = descriptor.initializer();
}
} else {
descriptor = {};
Expand All @@ -830,15 +835,21 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aureli
descriptor.enumerable = true;
}

delete descriptor.value;
delete descriptor.writable;
delete descriptor.initializer;

Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);

descriptor.get = function () {
return this[innerPropertyName];
};
descriptor.set = function (newValue) {
var oldValue = this[innerPropertyName];

this[innerPropertyName] = newValue;
Reflect.defineProperty(this, innerPropertyName, { enumerable: false });

if (this[callbackName]) {
this[callbackName](newValue, oldValue, key);
}
Expand Down Expand Up @@ -3900,7 +3911,7 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aureli
StyleObserver.prototype._setProperty = function _setProperty(style, value) {
var priority = '';

if (value.indexOf('!important') !== -1) {
if (value.indexOf && value.indexOf('!important') !== -1) {
priority = 'important';
value = value.replace('!important', '');
}
Expand Down
12 changes: 12 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<a name="1.0.7"></a>
## [1.0.7](https://github.com/aurelia/binding/compare/1.0.6...v1.0.7) (2016-10-05)


### Bug Fixes

* **observable:** backing property should not be enumerable ([521270b](https://github.com/aurelia/binding/commit/521270b))
* **observable:** handle descriptor with set ([fa3dafb](https://github.com/aurelia/binding/commit/fa3dafb)), closes [#511](https://github.com/aurelia/binding/issues/511)
* **StyleObserver:** handle numbers ([ca4933d](https://github.com/aurelia/binding/commit/ca4933d)), closes [#518](https://github.com/aurelia/binding/issues/518)



<a name="1.0.6"></a>
## [1.0.6](https://github.com/aurelia/binding/compare/1.0.5...v1.0.6) (2016-09-29)

Expand Down
4 changes: 2 additions & 2 deletions doc/example-dist/binding-checkboxes/objects-matcher/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ <h4>Products</h4>
<input type="checkbox" model.bind="{ id: 1, name: 'CPU' }"
matcher.bind="productMatcher"
checked.bind="selectedProducts">
Motherboard
CPU
</label>
<label>
<input type="checkbox" model.bind="{ id: 2, name: 'Memory' }"
matcher.bind="productMatcher"
checked.bind="selectedProducts">
Motherboard
Memory
</label>

Selected products:
Expand Down
4 changes: 2 additions & 2 deletions doc/example-dist/binding-radios/objects-matcher/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ <h4>Products</h4>
model.bind="{ id: 1, name: 'CPU' }"
matcher.bind="productMatcher"
checked.bind="selectedProduct">
Motherboard
CPU
</label>
<label>
<input type="radio" name="objects-matcher"
model.bind="{ id: 2, name: 'Memory' }"
matcher.bind="productMatcher"
checked.bind="selectedProduct">
Motherboard
Memory
</label>

Selected product: ${selectedProduct.id} - ${selectedProduct.name}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-binding",
"version": "1.0.6",
"version": "1.0.7",
"description": "A modern databinding library for JavaScript and HTML.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 8bafaf8

Please sign in to comment.