Skip to content

Commit f3eecce

Browse files
committed
refactor(runtime): drop the require() optional-module placeholder
1 parent 54fc93b commit f3eecce

2 files changed

Lines changed: 0 additions & 11 deletions

File tree

‎test-app/runtime/src/main/cpp/ModuleInternal.cpp‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,6 @@ static std::string PromiseRejectionMessage(Isolate* isolate, Local<Promise> prom
8686
return errorMessage;
8787
}
8888

89-
// Helper function to check if a module name looks like an optional external module
90-
bool ModuleInternal::IsLikelyOptionalModule(const std::string& moduleName) {
91-
// Check if it's a bare module name (no path separators) that could be an npm package
92-
if (moduleName.find('/') == std::string::npos && moduleName.find('\\') == std::string::npos &&
93-
moduleName[0] != '.' && moduleName[0] != '~' && moduleName[0] != '/') {
94-
return true;
95-
}
96-
return false;
97-
}
98-
9989
// A package-style specifier: neither a path nor a scheme, so it may be claimed
10090
// by a registry rather than resolved on disk.
10191
static bool IsBareSpecifier(const std::string& specifier) {

‎test-app/runtime/src/main/cpp/ModuleInternal.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class ModuleInternal {
3838
static void CheckFileExists(v8::Isolate* isolate, const std::string& path, const std::string& baseDir);
3939

4040
// Helper functions for ES module support
41-
static bool IsLikelyOptionalModule(const std::string& moduleName);
4241
static bool IsESModule(const std::string& path);
4342
static v8::Local<v8::Value> LoadESModule(v8::Isolate* isolate, const std::string& path);
4443

0 commit comments

Comments
 (0)