Skip to content

Commit

Permalink
Only support caching on v8
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
Edward Drapkin authored and zertosh committed Jan 23, 2018
1 parent 0acfd7f commit f8b0388
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions v8-compile-cache.js
Expand Up @@ -289,6 +289,9 @@ function slashEscape(str) {
}

function supportsCachedData() {
if (!process.versions.v8) {
return false;
}
var script = new vm.Script('""', {produceCachedData: true});
return script.cachedDataProduced != null;
}
Expand Down

0 comments on commit f8b0388

Please sign in to comment.