lint docs

This commit is contained in:
Leo Horie 2016-08-17 09:09:45 -04:00
parent 7718ef4c81
commit 8c9cc0e1f4
4 changed files with 17 additions and 15 deletions

View file

@ -44,7 +44,10 @@ function ensureCodeIsRunnable(file, data) {
}
try {
new Function("console,fetch", code).call(this, silentConsole, fetch)
new Function("console,fetch,module,require", code).call(this, silentConsole, fetch, {exports: {}}, function(dep) {
if (dep.indexOf("./mycomponent") === 0) return {view: function() {}}
if (dep === "mithril") return m
})
}
catch (e) {console.log(file + " - javascript code cannot run\n\n" + e.stack + "\n\n" + code + "\n\n---\n\n")}