Skip to content

Commit

Permalink
Merge pull request #3 from martinoppitz/help/update-virtual-modules
Browse files Browse the repository at this point in the history
fix: 'backendOrStorage' is not defined  no-undef
  • Loading branch information
syvb committed Nov 11, 2020
2 parents 1993448 + ac1304c commit 1d50ad9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/virtual.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ const path = require('path');
let inode = 45000000;

function createWebpackData(result) {
return (function(backendOrStorage) {
return (function(storage) {
// In Webpack v5, this variable is a "Backend", and has the data stored in a field
// _data. In V4, the `_` prefix isn't present.
if (backendOrStorage._data) {
const curLevelIdx = backendOrStorage._currentLevel;
const curLevel = backendOrStorage._levels[curLevelIdx];
if (storage._data) {
const curLevelIdx = storage._currentLevel;
const curLevel = storage._levels[curLevelIdx];
return {
result: this.result,
level: curLevel
Expand Down Expand Up @@ -173,7 +173,7 @@ function getData(storage, key) {

function setData(storage, key, valueFactory) {
const storageData = getStorageData(storage);
const value = valueFactory(backendOrStorage);
const value = valueFactory(storage);

if (storageData instanceof Map) {
storageData.set(key, value);
Expand Down

0 comments on commit 1d50ad9

Please sign in to comment.