Skip to content

Commit

Permalink
Update internal Node.js function call
Browse files Browse the repository at this point in the history
This updates the call to _resolveLookupPaths. It returns a string
by default since Node.js v8 when called with a third truthy argument.
The backwards compatible return value should change soon, so detect
what return type is used and handle both cases.

Refs: nodejs/node#26983
  • Loading branch information
BridgeAR committed Apr 5, 2019
1 parent 25264e3 commit 1237a97
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion build/get-nodejs/get-nodejs-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ YUI.add('get', function (Y, NAME) {
} else {
try {
// Try to resolve paths relative to the module that required yui.
url = Module._findPath(url, Module._resolveLookupPaths(url, module.parent.parent)[1]);
var path = Module._resolveLookupPaths(url, module.parent.parent, true);

url = Module._findPath(url, (typeof path === 'string' || path === null) ? path : path[1]);

if (Y.config.useSync) {
//Needs to be in useSync
Expand Down
4 changes: 3 additions & 1 deletion build/get-nodejs/get-nodejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ YUI.add('get', function (Y, NAME) {
} else {
try {
// Try to resolve paths relative to the module that required yui.
url = Module._findPath(url, Module._resolveLookupPaths(url, module.parent.parent)[1]);
var path = Module._resolveLookupPaths(url, module.parent.parent, true);

url = Module._findPath(url, (typeof path === 'string' || path === null) ? path : path[1]);

if (Y.config.useSync) {
//Needs to be in useSync
Expand Down
4 changes: 3 additions & 1 deletion build/yui-nodejs/yui-nodejs-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -4383,7 +4383,9 @@ YUI.add('get', function (Y, NAME) {
} else {
try {
// Try to resolve paths relative to the module that required yui.
url = Module._findPath(url, Module._resolveLookupPaths(url, module.parent.parent)[1]);
var path = Module._resolveLookupPaths(url, module.parent.parent, true);

url = Module._findPath(url, (typeof path === 'string' || path === null) ? path : path[1]);

if (Y.config.useSync) {
//Needs to be in useSync
Expand Down
4 changes: 3 additions & 1 deletion build/yui-nodejs/yui-nodejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4132,7 +4132,9 @@ YUI.add('get', function (Y, NAME) {
} else {
try {
// Try to resolve paths relative to the module that required yui.
url = Module._findPath(url, Module._resolveLookupPaths(url, module.parent.parent)[1]);
var path = Module._resolveLookupPaths(url, module.parent.parent, true);

url = Module._findPath(url, (typeof path === 'string' || path === null) ? path : path[1]);

if (Y.config.useSync) {
//Needs to be in useSync
Expand Down

0 comments on commit 1237a97

Please sign in to comment.