Skip to content

Instantly share code, notes, and snippets.

@bbrowning
Last active Sep 16, 2015
Embed
What would you like to do?
undertow.js w/ jvm-npm.js
--- jvm-npm.js.orig 2015-09-16 09:19:07.007874748 -0400
+++ jvm-npm.js 2015-09-15 16:25:25.607810957 -0400
@@ -237,7 +237,7 @@
function resolveCoreModule(id, root) {
var name = normalizeName(id);
var classloader = java.lang.Thread.currentThread().getContextClassLoader();
- if (classloader.findResource(name))
+ if (classloader.findResource(name, false))
return { path: name, core: true };
}
// test loading modules with jvm-npm and undertow.js
load('classpath:jvm-npm.js');
var hello = require('my-module');
hello('Bob!');
// Rest of original kitchensink.js below here
module.exports = function sayHello(name) {
java.lang.System.out.println("Hello " + name);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment