diff --git a/lib/module.js b/lib/module.js index 6693bedeb1c7b6..b0c377df331e97 100644 --- a/lib/module.js +++ b/lib/module.js @@ -218,14 +218,9 @@ Module._findPath = function(request, paths, isMain) { if (!filename && rc === 1) { // Directory. if (exts === undefined) exts = Object.keys(Module._extensions); - filename = tryPackage(basePath, exts, isMain); - } - - if (!filename && rc === 1) { // Directory. - // try it with each of the extensions at "index" - if (exts === undefined) - exts = Object.keys(Module._extensions); - filename = tryExtensions(path.resolve(basePath, 'index'), exts, isMain); + filename = tryPackage(basePath, exts, isMain) || + // try it with each of the extensions at "index" + tryExtensions(path.resolve(basePath, 'index'), exts, isMain); } if (filename) { diff --git a/tools/genv8constants.py b/tools/genv8constants.py index 45b4ae317125cd..b516728635b7a8 100755 --- a/tools/genv8constants.py +++ b/tools/genv8constants.py @@ -84,10 +84,10 @@ def out_define(): # 6-character margin, 2-characters + 1 space for each field idx = 6 + i * 3; octetstr = line[idx:idx+3] - if not numpattern.match(octetstr): + if curr_octet > octets: break; - if curr_octet > octets: + if not numpattern.match(octetstr): break; curr_val += int('0x%s' % octetstr, 16) << (curr_octet * 8);