Skip to content

Commit

Permalink
JSModules : Only enable ComponentLoader for nidium frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
efyx committed May 27, 2017
1 parent 526de03 commit 72591d8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Binding/JSModules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
#include <jsfriendapi.h>
#include <ape_timers_next.h>

#include "Frontend/NML.h"
#include "Binding/NidiumJS.h"
#include "Binding/JSUtils.h"
#include "Binding/ThreadLocalContext.h"
#include "IO/Stream.h"

#ifdef NIDIUM_PRODUCT_FRONTEND
#include "Frontend/NML.h"
#endif

#define NIDIUM_MODULES_PATHS_COUNT 2
#define NIDIUM_MODULES_EXTENSION_COUNT 5

Expand Down Expand Up @@ -339,6 +342,7 @@ JS::Value JSModule::require(char *name)
}

if (cmodule->m_ModuleType == JSModule::kModuleType_NidiumComponent) {
#ifdef NIDIUM_PRODUCT_FRONTEND
JS::RootedValue loader(m_Cx);
JS::RootedValue requireVal(m_Cx);
JS::RootedObject require(m_Cx);
Expand Down Expand Up @@ -384,9 +388,13 @@ JS::Value JSModule::require(char *name)

return ret;
} else {
JS_ReportError(m_Cx, "No ComponentLoader defined");
JS_ReportError(m_Cx, "No ComponentLoader defined.");
return ret;
}
#else
JS_ReportError(m_Cx, "Unsupported operation.");
return JS::UndefinedValue();
#endif
} else if (cmodule->m_ModuleType == JSModule::kModuleType_JS) {
JS::RootedObject expObj(m_Cx, cmodule->m_Exports);
JS::CompileOptions options(m_Cx);
Expand Down

0 comments on commit 72591d8

Please sign in to comment.