bare-module 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/loader.js +29 -6
- package/package.json +1 -1
- package/prebuilds/android-arm/bare-module.bare +0 -0
- package/prebuilds/android-arm64/bare-module.bare +0 -0
- package/prebuilds/android-ia32/bare-module.bare +0 -0
- package/prebuilds/android-x64/bare-module.bare +0 -0
- package/prebuilds/darwin-arm64/bare-module.bare +0 -0
- package/prebuilds/darwin-x64/bare-module.bare +0 -0
- package/prebuilds/ios-arm64/bare-module.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-module.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-module.bare +0 -0
- package/prebuilds/linux-arm64/bare-module.bare +0 -0
- package/prebuilds/linux-x64/bare-module.bare +0 -0
- package/prebuilds/win32-arm64/bare-module.bare +0 -0
- package/prebuilds/win32-x64/bare-module.bare +0 -0
package/lib/loader.js
CHANGED
|
@@ -781,6 +781,8 @@ module.exports = class ModuleLoader {
|
|
|
781
781
|
this._resolveOptions()
|
|
782
782
|
)
|
|
783
783
|
|
|
784
|
+
const candidates = []
|
|
785
|
+
|
|
784
786
|
let next = resolver.next()
|
|
785
787
|
|
|
786
788
|
while (next.done !== true) {
|
|
@@ -803,6 +805,8 @@ module.exports = class ModuleLoader {
|
|
|
803
805
|
} else {
|
|
804
806
|
const url = value.resolution
|
|
805
807
|
|
|
808
|
+
candidates.push(url)
|
|
809
|
+
|
|
806
810
|
if (url.protocol === 'builtin:' || url.protocol === 'data:' || this.get(url) !== null) {
|
|
807
811
|
this._cacheResolution(parentURL, specifier, condition, url)
|
|
808
812
|
|
|
@@ -821,7 +825,7 @@ module.exports = class ModuleLoader {
|
|
|
821
825
|
}
|
|
822
826
|
}
|
|
823
827
|
|
|
824
|
-
throw notFound(condition, specifier, parentURL)
|
|
828
|
+
throw notFound(condition, specifier, parentURL, candidates)
|
|
825
829
|
}
|
|
826
830
|
|
|
827
831
|
async _resolve(specifier, parentURL, condition) {
|
|
@@ -833,6 +837,8 @@ module.exports = class ModuleLoader {
|
|
|
833
837
|
this._resolveOptions()
|
|
834
838
|
)
|
|
835
839
|
|
|
840
|
+
const candidates = []
|
|
841
|
+
|
|
836
842
|
let next = resolver.next()
|
|
837
843
|
|
|
838
844
|
while (next.done !== true) {
|
|
@@ -863,6 +869,8 @@ module.exports = class ModuleLoader {
|
|
|
863
869
|
} else {
|
|
864
870
|
const url = value.resolution
|
|
865
871
|
|
|
872
|
+
candidates.push(url)
|
|
873
|
+
|
|
866
874
|
if (url.protocol === 'builtin:' || url.protocol === 'data:' || this.get(url) !== null) {
|
|
867
875
|
this._cacheResolution(parentURL, specifier, condition, url)
|
|
868
876
|
|
|
@@ -883,7 +891,7 @@ module.exports = class ModuleLoader {
|
|
|
883
891
|
}
|
|
884
892
|
}
|
|
885
893
|
|
|
886
|
-
throw notFound(condition, specifier, parentURL)
|
|
894
|
+
throw notFound(condition, specifier, parentURL, candidates)
|
|
887
895
|
}
|
|
888
896
|
|
|
889
897
|
_resolveArtifact(referrer, specifier, condition, parentURL = referrer.url) {
|
|
@@ -973,14 +981,29 @@ async function drive(generator, protocol, driveLink, semaphore, answers = null)
|
|
|
973
981
|
return next.value
|
|
974
982
|
}
|
|
975
983
|
|
|
976
|
-
function notFound(condition, specifier, parentURL) {
|
|
984
|
+
function notFound(condition, specifier, parentURL, candidates = []) {
|
|
977
985
|
switch (condition) {
|
|
978
986
|
case 'addon':
|
|
979
|
-
return errors.ADDON_NOT_FOUND(
|
|
987
|
+
return errors.ADDON_NOT_FOUND(
|
|
988
|
+
`Cannot find addon '${specifier}'`,
|
|
989
|
+
specifier,
|
|
990
|
+
parentURL,
|
|
991
|
+
candidates
|
|
992
|
+
)
|
|
980
993
|
case 'asset':
|
|
981
|
-
return errors.ASSET_NOT_FOUND(
|
|
994
|
+
return errors.ASSET_NOT_FOUND(
|
|
995
|
+
`Cannot find asset '${specifier}'`,
|
|
996
|
+
specifier,
|
|
997
|
+
parentURL,
|
|
998
|
+
candidates
|
|
999
|
+
)
|
|
982
1000
|
default:
|
|
983
|
-
return errors.MODULE_NOT_FOUND(
|
|
1001
|
+
return errors.MODULE_NOT_FOUND(
|
|
1002
|
+
`Cannot find module '${specifier}'`,
|
|
1003
|
+
specifier,
|
|
1004
|
+
parentURL,
|
|
1005
|
+
candidates
|
|
1006
|
+
)
|
|
984
1007
|
}
|
|
985
1008
|
}
|
|
986
1009
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|