Skip to content

Instantly share code, notes, and snippets.

@bbrowning
Last active September 16, 2015 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbrowning/9bba9bc82fa2251ab0a7 to your computer and use it in GitHub Desktop.
Save bbrowning/9bba9bc82fa2251ab0a7 to your computer and use it in GitHub Desktop.
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