Skip to content

Commit

Permalink
Remove unused canLoadFile function from HermesExecutor.java (#39481)
Browse files Browse the repository at this point in the history
Summary:

This function is hardcoded to `true` and is never used, so I'm removing it.
I found no relevant usages in OSS so that can probably go.
Also see: #39292 where it got reported.

Changelog:
[Android] [Removed] - Remove unused `canLoadFile` function from HermesExecutor.java

Reviewed By: yungsters, mdvacca

Differential Revision: D49320244
  • Loading branch information
cortinico authored and facebook-github-bot committed Sep 18, 2023
1 parent 0ab8b40 commit 44ae23c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ public String getName() {
return "HermesExecutor" + mode_;
}

/**
* Return whether this class can load a file at the given path, based on a binary compatibility
* check between the contents of the file and the Hermes VM.
*
* @param path the path containing the file to inspect.
* @return whether the given file is compatible with the Hermes VM.
*/
public static native boolean canLoadFile(String path);

private static native HybridData initHybridDefaultConfig(
boolean enableDebugger, String debuggerName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,12 @@ class HermesExecutorHolder
return makeCxxInstance(std::move(factory));
}

static bool canLoadFile(jni::alias_ref<jclass>, const std::string& path) {
return true;
}

static void registerNatives() {
registerHybrid(
{makeNativeMethod("initHybrid", HermesExecutorHolder::initHybrid),
makeNativeMethod(
"initHybridDefaultConfig",
HermesExecutorHolder::initHybridDefaultConfig),
makeNativeMethod("canLoadFile", HermesExecutorHolder::canLoadFile)});
HermesExecutorHolder::initHybridDefaultConfig)});
}

private:
Expand Down

0 comments on commit 44ae23c

Please sign in to comment.