{
Scriptable module = objArg(args, 0, Scriptable.class, true);
String fileName = stringArg(args, 1);
// This method is called anonymously by "module.js"
ScriptRunner runner = getRunner(cx);
Matcher m = FILE_NAME_PATTERN.matcher(fileName);
if (!m.matches()) {
throw Utils.makeError(cx, thisObj, "dlopen(" + fileName + "): Native module not supported");
}
String name = m.group(4);
try {
Object nativeMod = runner.initializeModule(name, ModuleRegistry.ModuleType.NATIVE, cx,
runner.getScriptScope());
if (log.isTraceEnabled()) {
log.trace("Creating new instance {} of native module {}",
System.identityHashCode(nativeMod), name);
}