Skip to content

Commit

Permalink
Merge pull request #14457 from webpack/fix-serialization-context
Browse files Browse the repository at this point in the history
fix: provide correct serialization context
  • Loading branch information
sokra committed Oct 11, 2021
2 parents 2eecffb + dfbce79 commit 2306d13
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/serialization/Serializer.js
Expand Up @@ -16,9 +16,7 @@ class Serializer {
let current = obj;
for (const middleware of this.serializeMiddlewares) {
if (current && typeof current.then === "function") {
current = current.then(
data => data && middleware.serialize(data, context)
);
current = current.then(data => data && middleware.serialize(data, ctx));
} else if (current) {
try {
current = middleware.serialize(current, ctx);
Expand All @@ -36,7 +34,7 @@ class Serializer {
let current = value;
for (const middleware of this.deserializeMiddlewares) {
if (current && typeof current.then === "function") {
current = current.then(data => middleware.deserialize(data, context));
current = current.then(data => middleware.deserialize(data, ctx));
} else {
current = middleware.deserialize(current, ctx);
}
Expand Down

0 comments on commit 2306d13

Please sign in to comment.