Skip to content

Commit

Permalink
Change: Use original sandbox obj as VM context for mapping execution
Browse files Browse the repository at this point in the history
  • Loading branch information
snatalenko committed Jul 14, 2022
1 parent e2a7963 commit a55beb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createMapper.ts
Expand Up @@ -51,7 +51,7 @@ export default function createMapper<TSource, TResult>(map: TRootMapping, option
...options?.extensions
};

const context = vm.createContext(sandbox);
vm.createContext(sandbox);

return (document: TSource): TResult | undefined => {

Expand All @@ -64,7 +64,7 @@ export default function createMapper<TSource, TResult>(map: TRootMapping, option
throw new TypeError(`Extension "${conflictingKey}" conflicts with a field name passed in input`);
}

script.runInContext(context);
script.runInContext(sandbox);

return sandbox.$result;
};
Expand Down

0 comments on commit a55beb0

Please sign in to comment.