MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / canModuleBeUnsafe

Method canModuleBeUnsafe

src/builtin/module_file_access.cpp:90–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 bool ModuleFileAccess::canModuleBeUnsafe ( const string & mod, const string & fileName ) const {
91 if(failed() || !moduleUnsafe) return FileAccess::canModuleBeUnsafe(mod,fileName);
92 vec4f args[2];
93 args[0] = cast<const char *>::from(mod.c_str());
94 args[1] = cast<const char *>::from(fileName.c_str());
95 auto res = context->evalWithCatch(moduleUnsafe, args, nullptr);
96 auto exc = context->getException(); exc;
97 DAS_ASSERTF(!exc, "exception failed in `module_unsafe`: %s", exc);
98 return cast<bool>::to(res);
99 }
100
101 bool ModuleFileAccess::canBeRequired ( const string & mod, const string & fileName, bool isPublic ) const {
102 if(failed() || !canModuleBeRequired) return FileAccess::canBeRequired(mod,fileName,isPublic);

Callers 1

parseDaScriptFunction · 0.45

Calls 5

canModuleBeUnsafeFunction · 0.85
toFunction · 0.85
evalWithCatchMethod · 0.80
failedFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected