Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin Schaffer <austin.schaffer@ryansg.com>2019-12-19 11:52:12 -0500
committerSchaffer, Austin <austin.schaffer@ryansg.com>2019-12-19 14:42:10 -0500
commite2a9d17dc6e47c4df46f57904a886fbfcab71ed9 (patch)
treec7e5d5dd90d5ceabbafd1ce7731a857dcf8d2536
parentcaf2c776b6422b2d6a7ae80110fe9a69947e032a (diff)
downloadliza-e2a9d17dc6e47c4df46f57904a886fbfcab71ed9.tar.gz
liza-e2a9d17dc6e47c4df46f57904a886fbfcab71ed9.tar.bz2
liza-e2a9d17dc6e47c4df46f57904a886fbfcab71ed9.zip
[DEV-5312] Do not use Object.create when applying delta
-rw-r--r--src/system/DeltaProcessor.ts4
-rw-r--r--test/system/DeltaProcessorTest.ts6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/system/DeltaProcessor.ts b/src/system/DeltaProcessor.ts
index b9d792f..41b9a01 100644
--- a/src/system/DeltaProcessor.ts
+++ b/src/system/DeltaProcessor.ts
@@ -201,14 +201,14 @@ export class DeltaProcessor
if ( delta.type === this.DELTA_DATA )
{
bucket_state = applyDelta(
- Object.create( bucket_state ),
+ bucket_state,
deltas[ i ].data,
);
}
else
{
ratedata_state = applyDelta(
- Object.create( ratedata_state ),
+ ratedata_state,
deltas[ i ].data,
);
}
diff --git a/test/system/DeltaProcessorTest.ts b/test/system/DeltaProcessorTest.ts
index 84f955a..e204165 100644
--- a/test/system/DeltaProcessorTest.ts
+++ b/test/system/DeltaProcessorTest.ts
@@ -63,6 +63,7 @@ describe( 'system.DeltaProcessor', () =>
lastUpdate: 123123123,
data: {
+ bar: [ 'initial and unchanged' ],
foo: [ 'third' ],
state: [ 'a', 'b', 'c', 'd' ],
},
@@ -126,6 +127,7 @@ describe( 'system.DeltaProcessor', () =>
state: [ undefined, null ],
},
bucket: {
+ bar: [ 'initial and unchanged' ],
foo: [ 'first' ],
state: [ 'a', 'b' ],
},
@@ -140,6 +142,7 @@ describe( 'system.DeltaProcessor', () =>
state: [ undefined, null ],
},
bucket: {
+ bar: [ 'initial and unchanged' ],
foo: [ 'first' ],
state: [ 'a', 'b' ],
},
@@ -157,6 +160,7 @@ describe( 'system.DeltaProcessor', () =>
state: [ undefined, undefined, null ],
},
bucket: {
+ bar: [ 'initial and unchanged' ],
foo: [ 'second' ],
state: [ 'a', 'b', 'c' ],
},
@@ -171,6 +175,7 @@ describe( 'system.DeltaProcessor', () =>
state: [ undefined, undefined, null ],
},
bucket: {
+ bar: [ 'initial and unchanged' ],
foo: [ 'second' ],
state: [ 'a', 'b', 'c' ],
},
@@ -188,6 +193,7 @@ describe( 'system.DeltaProcessor', () =>
state: [ undefined, undefined, undefined, null ],
},
bucket: {
+ bar: [ 'initial and unchanged' ],
foo: [ 'third' ],
state: [ 'a', 'b', 'c', 'd' ],
},