Cache versions that do not match the range

This commit is contained in:
Kevin Sawicki
2014-10-16 16:32:52 -07:00
parent 2570c20da0
commit 1ddb956a94

View File

@@ -7,12 +7,17 @@ class Range extends semver.Range
constructor: ->
super
@matchedVersions = new Set()
@unmatchedVersions = new Set()
test: (version) ->
return true if @matchedVersions.has(version)
return false if @unmatchedVersions.has(version)
matches = super
@matchedVersions.add(version) if matches
if matches
@matchedVersions.add(version)
else
@unmatchedVersions.add(version)
matches
nativeModules = process.binding('natives')