Skip to content

Commit

Permalink
Fixed the constructor by copy of the 'LocalPropertyManager' class and…
Browse files Browse the repository at this point in the history
… the 'LocalLockManager' class
  • Loading branch information
AdrienCastex committed Jul 9, 2017
1 parent 72043d2 commit a5fb4c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/manager/v2/fileSystem/LockManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ var LocalLockManager = (function () {
function LocalLockManager(serializedData) {
this.locks = [];
if (serializedData)
Object.defineProperties(this, serializedData);
for (var name_1 in serializedData)
this[name_1] = serializedData[name_1];
}
LocalLockManager.prototype.getLocks = function (callback) {
this.locks = this.locks.filter(function (lock) { return !lock.expired(); });
Expand Down
3 changes: 2 additions & 1 deletion lib/manager/v2/fileSystem/PropertyManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ var LocalPropertyManager = (function () {
function LocalPropertyManager(serializedData) {
this.properties = {};
if (serializedData)
Object.defineProperties(this, serializedData);
for (var name_1 in serializedData)
this[name_1] = serializedData[name_1];
}
LocalPropertyManager.prototype.setProperty = function (name, value, attributes, callback) {
this.properties[name] = {
Expand Down
3 changes: 2 additions & 1 deletion src/manager/v2/fileSystem/LockManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export class LocalLockManager implements ILockManager
constructor(serializedData ?: any)
{
if(serializedData)
Object.defineProperties(this, serializedData as any);
for(const name in serializedData)
this[name] = serializedData[name];
}

getLocks(callback : ReturnCallback<Lock[]>) : void
Expand Down
3 changes: 2 additions & 1 deletion src/manager/v2/fileSystem/PropertyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export class LocalPropertyManager implements IPropertyManager
constructor(serializedData ?: any)
{
if(serializedData)
Object.defineProperties(this, serializedData as any);
for(const name in serializedData)
this[name] = serializedData[name];
}

setProperty(name : string, value : ResourcePropertyValue, attributes : PropertyAttributes, callback : SimpleCallback) : void
Expand Down

0 comments on commit a5fb4c0

Please sign in to comment.