iobroker.javascript 8.7.5 → 8.7.6
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/README.md +3 -3
- package/admin/asset-manifest.json +5 -5
- package/admin/static/js/253.59baf1c4.chunk.js +2 -0
- package/admin/static/js/{253.cda1c762.chunk.js.map → 253.59baf1c4.chunk.js.map} +1 -1
- package/admin/static/js/{253.cda1c762.chunk.js → 253.d43d3d29.chunk.js} +2 -2
- package/admin/static/js/253.d43d3d29.chunk.js.map +1 -0
- package/admin/static/js/{main.6c68c8bf.js → main.30e63e4e.js} +2 -2
- package/admin/static/js/{main.6c68c8bf.js.map → main.30e63e4e.js.map} +1 -1
- package/admin/static/js/main.fb205034.js +2 -0
- package/admin/static/js/main.fb205034.js.map +1 -0
- package/admin/tab.html +1 -1
- package/io-package.json +14 -14
- package/lib/sandbox.js +18 -12
- package/package.json +1 -1
package/lib/sandbox.js
CHANGED
|
@@ -541,24 +541,30 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
if (
|
|
544
|
+
if (mods[md]) {
|
|
545
|
+
return mods[md];
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
let error;
|
|
550
|
+
|
|
551
|
+
try {
|
|
552
|
+
mods[md] = require(adapter.getAdapterScopedPackageIdentifier ? adapter.getAdapterScopedPackageIdentifier(md) : md);
|
|
553
|
+
return mods[md];
|
|
554
|
+
} catch (e) {
|
|
555
|
+
error = e;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
try {
|
|
545
559
|
// the user requires a module which is not specified in the additional node modules
|
|
546
560
|
// for backward compatibility we check if the module can simply be required directly before we fail (e.g. direct dependencies of javascript adapter)
|
|
547
561
|
adapter.log.debug(`Try direct require of "${md}" as not specified in the additional dependencies`);
|
|
548
562
|
mods[md] = require(md);
|
|
549
|
-
}
|
|
550
563
|
|
|
551
|
-
if (mods[md]) {
|
|
552
564
|
return mods[md];
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return mods[md];
|
|
558
|
-
} catch (e) {
|
|
559
|
-
adapter.setState(`scriptProblem.${name.substring('script.js.'.length)}`, { val: true, ack: true, c: 'require' });
|
|
560
|
-
context.logError(name, e, 6);
|
|
561
|
-
}
|
|
565
|
+
} catch (e) {
|
|
566
|
+
context.logError(name, error || e, 6);
|
|
567
|
+
adapter.setState(`scriptProblem.${name.substring('script.js.'.length)}`, { val: true, ack: true, c: 'require' });
|
|
562
568
|
}
|
|
563
569
|
},
|
|
564
570
|
Buffer: Buffer,
|