Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19491 from atom/fix-compilation-cache-issue
Browse files Browse the repository at this point in the history
Do not store null buffers on the cacheStore
  • Loading branch information
rafeca committed Jun 12, 2019
2 parents a0aab86 + aa987c7 commit 0226ae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/native-compile-cache.js
Expand Up @@ -43,7 +43,7 @@ class NativeCompileCache {
const script = new vm.Script(code, { filename, produceCachedData: true });
return {
result: script.runInThisContext(),
cacheBuffer: script.cachedData
cacheBuffer: script.cachedDataProduced ? script.cachedData : null
};
}

Expand Down Expand Up @@ -102,7 +102,7 @@ class NativeCompileCache {
console.error(`Error running script ${filename}`);
throw err;
}
if (compilationResult.cacheBuffer !== null) {
if (compilationResult.cacheBuffer) {
self.cacheStore.set(cacheKey, compilationResult.cacheBuffer);
}
compiledWrapper = compilationResult.result;
Expand Down

0 comments on commit 0226ae9

Please sign in to comment.