Last active
September 16, 2015 13:19
-
-
Save bbrowning/9bba9bc82fa2251ab0a7 to your computer and use it in GitHub Desktop.
undertow.js w/ jvm-npm.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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 }; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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