Skip to content

Commit f6806ff

Browse files
committed
✨ feat: Remove protection on android node from class loader
1 parent 8549a7a commit f6806ff

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/main/java/com/caoccao/javet/interop/JavetClassLoader.java

+1-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
* @since 0.8.0
3737
*/
3838
final class JavetClassLoader extends ClassLoader {
39-
private static final String ERROR_NODE_JS_IS_NOT_SUPPORTED_ON_ANDROID = "Node.js is not supported on Android.";
4039
private static final String JAVET_LIB_LOADER_CLASS_NAME = JavetLibLoader.class.getName();
4140
private static final String METHOD_LOAD = "load";
4241
private static final String METHOD_SET_LIB_LOADING_LISTENER = "setLibLoadingListener";
@@ -66,9 +65,7 @@ final class JavetClassLoader extends ClassLoader {
6665
IV8Native getNative() throws JavetException {
6766
if (JavetOSUtils.IS_ANDROID) {
6867
if (jsRuntimeType.isNode()) {
69-
throw new JavetException(
70-
JavetError.LibraryNotLoaded,
71-
SimpleMap.of(JavetError.PARAMETER_REASON, ERROR_NODE_JS_IS_NOT_SUPPORTED_ON_ANDROID));
68+
return new NodeNative();
7269
}
7370
return new V8Native();
7471
} else {
@@ -95,11 +92,6 @@ IV8Native getNative() throws JavetException {
9592
*/
9693
void load() throws JavetException {
9794
if (JavetOSUtils.IS_ANDROID) {
98-
if (jsRuntimeType.isNode()) {
99-
throw new JavetException(
100-
JavetError.LibraryNotLoaded,
101-
SimpleMap.of(JavetError.PARAMETER_REASON, ERROR_NODE_JS_IS_NOT_SUPPORTED_ON_ANDROID));
102-
}
10395
JavetLibLoader javetLibLoader = new JavetLibLoader(jsRuntimeType);
10496
javetLibLoader.load();
10597
} else {

0 commit comments

Comments
 (0)