Fix for node 8.x solc tests.
This commit is contained in:
parent
fa25e61f77
commit
133291e9ba
@ -125,8 +125,13 @@ function _compile(_solc: any, source: string, options?: CompilerOptions): Array<
|
|||||||
// Creates a require which will first search from the current location,
|
// Creates a require which will first search from the current location,
|
||||||
// and for solc will fallback onto the version included in @ethersproject/cli
|
// and for solc will fallback onto the version included in @ethersproject/cli
|
||||||
export function customRequire(path: string): (name: string) => any {
|
export function customRequire(path: string): (name: string) => any {
|
||||||
const pathRequire = _module.createRequireFromPath(resolve(path, "./sandbox.js"));
|
// Node 8.x does not support createRequireFromPath
|
||||||
const libRequire = _module.createRequireFromPath(resolve(__filename));
|
const createRequire = (_module.createRequireFromPath || (function(path: string) {
|
||||||
|
return require
|
||||||
|
}));
|
||||||
|
|
||||||
|
const pathRequire = createRequire(resolve(path, "./sandbox.js"));
|
||||||
|
const libRequire = createRequire(resolve(__filename));
|
||||||
|
|
||||||
return function(name: string): any {
|
return function(name: string): any {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user