Skip to content

Commit

Permalink
chore(all): prepare release 0.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 6, 2015
1 parent 854930a commit 478c969
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 94 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": "0.3.3",
"version": "0.3.4",
"description": "A modern databinding library for JavaScript and HTML.",
"license": "MIT",
"keywords": [
Expand Down
28 changes: 16 additions & 12 deletions dist/amd/observer-locator.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,29 @@ define(["exports", "aurelia-task-queue", "./array-observation", "./event-manager
function createObserversLookup(obj) {
var value = {};

Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try {
Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
} catch (_) {}

return value;
}

function createObserverLookup(obj) {
var value = new OoObjectObserver(obj);

Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try {
Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
} catch (_) {}

return value;
}
Expand Down
22 changes: 13 additions & 9 deletions dist/amd/property-observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ define(["exports"], function (exports) {
this.setValue = this.setterValue;
this.getValue = this.getterValue;

Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
try {
Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
} catch (_) {}
},
writable: true,
configurable: true
Expand All @@ -125,9 +127,11 @@ define(["exports"], function (exports) {

if (!this.observing) {
this.observing = true;
Object.observe(this.obj, function (changes) {
return _this.handleChanges(changes);
}, ["update", "add"]);
try {
Object.observe(this.obj, function (changes) {
return _this.handleChanges(changes);
}, ["update", "add"]);
} catch (_) {}
}

return function () {
Expand Down
28 changes: 16 additions & 12 deletions dist/commonjs/observer-locator.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,29 @@ var hasObjectObserve = (function detectObjectObserve() {
function createObserversLookup(obj) {
var value = {};

Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try {
Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
} catch (_) {}

return value;
}

function createObserverLookup(obj) {
var value = new OoObjectObserver(obj);

Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try {
Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
} catch (_) {}

return value;
}
Expand Down
22 changes: 13 additions & 9 deletions dist/commonjs/property-observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ var SetterObserver = exports.SetterObserver = (function () {
this.setValue = this.setterValue;
this.getValue = this.getterValue;

Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
try {
Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
} catch (_) {}
},
writable: true,
configurable: true
Expand All @@ -124,9 +126,11 @@ var OoObjectObserver = exports.OoObjectObserver = (function () {

if (!this.observing) {
this.observing = true;
Object.observe(this.obj, function (changes) {
return _this.handleChanges(changes);
}, ["update", "add"]);
try {
Object.observe(this.obj, function (changes) {
return _this.handleChanges(changes);
}, ["update", "add"]);
} catch (_) {}
}

return function () {
Expand Down
38 changes: 21 additions & 17 deletions dist/es6/observer-locator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {getArrayObserver} from './array-observation';
import {EventManager} from './event-manager';
import {DirtyChecker, DirtyCheckProperty} from './dirty-checking';
import {
SetterObserver,
OoObjectObserver,
OoPropertyObserver,
SetterObserver,
OoObjectObserver,
OoPropertyObserver,
ElementObserver
} from './property-observation';
import {All} from 'aurelia-dependency-injection';
Expand Down Expand Up @@ -57,25 +57,29 @@ var hasObjectObserve = (function detectObjectObserve() {
function createObserversLookup(obj) {
var value = {};

Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try{
Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
}catch(_){}

return value;
}

function createObserverLookup(obj) {
var value = new OoObjectObserver(obj);

Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try{
Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
}catch(_){}

return value;
}
Expand All @@ -101,7 +105,7 @@ export class ObserverLocator {
}

return observersLookup[propertyName] = this.createPropertyObserver(
obj,
obj,
propertyName
);
}
Expand Down Expand Up @@ -165,4 +169,4 @@ export class ObjectObservationAdapter {
getObserver(object, propertyName) {
throw new Error('BindingAdapters must implement createObserver(object, propertyName).');
}
}
}
28 changes: 16 additions & 12 deletions dist/es6/property-observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,21 @@ export class SetterObserver {
this.setValue = this.setterValue;
this.getValue = this.getterValue;

Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
try{
Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
}catch(_){}
}
}

export class OoObjectObserver {
constructor(obj){
this.obj = obj;
this.observers = {};
this.observers = {};
}

subscribe(propertyObserver, callback){
Expand All @@ -92,7 +94,9 @@ export class OoObjectObserver {

if(!this.observing){
this.observing = true;
Object.observe(this.obj, changes => this.handleChanges(changes), ['update', 'add']);
try{
Object.observe(this.obj, changes => this.handleChanges(changes), ['update', 'add']);
}catch(_){}
}

return function(){
Expand All @@ -111,11 +115,11 @@ export class OoObjectObserver {
var updates = {},
observers = this.observers,
i = changeRecords.length;

while(i--) {
var change = changeRecords[i],
name = change.name;

if(!(name in updates)){
var observer = observers[name];
updates[name] = true;
Expand Down Expand Up @@ -202,9 +206,9 @@ export class ElementObserver {
}

var callbacks = this.callbacks;

callbacks.push(callback);

return function(){
callbacks.splice(callbacks.indexOf(callback), 1);
if(callback.length === 0){
Expand Down
28 changes: 16 additions & 12 deletions dist/system/observer-locator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ System.register(["aurelia-task-queue", "./array-observation", "./event-manager",
function createObserversLookup(obj) {
var value = {};

Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try {
Object.defineProperty(obj, "__observers__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
} catch (_) {}

return value;
}

function createObserverLookup(obj) {
var value = new OoObjectObserver(obj);

Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
try {
Object.defineProperty(obj, "__observer__", {
enumerable: false,
configurable: false,
writable: false,
value: value
});
} catch (_) {}

return value;
}
Expand Down
22 changes: 13 additions & 9 deletions dist/system/property-observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ System.register([], function (_export) {
this.setValue = this.setterValue;
this.getValue = this.getterValue;

Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
try {
Object.defineProperty(this.obj, this.propertyName, {
configurable: true,
enumerable: true,
get: this.getValue.bind(this),
set: this.setValue.bind(this)
});
} catch (_) {}
},
writable: true,
configurable: true
Expand All @@ -129,9 +131,11 @@ System.register([], function (_export) {

if (!this.observing) {
this.observing = true;
Object.observe(this.obj, function (changes) {
return _this.handleChanges(changes);
}, ["update", "add"]);
try {
Object.observe(this.obj, function (changes) {
return _this.handleChanges(changes);
}, ["update", "add"]);
} catch (_) {}
}

return function () {
Expand Down
8 changes: 8 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 0.3.4 (2015-02-06)


#### Bug Fixes

* **observers:** do not fail on primitive observation attempt ([854930a5](http://github.com/aurelia/binding/commit/854930a50685836111f97119b1295e07190d6f34))


### 0.3.3 (2015-02-03)


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": "0.3.3",
"version": "0.3.4",
"description": "A modern databinding library for JavaScript and HTML.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 478c969

Please sign in to comment.