Permalink
Browse files

Added support for node.js

  • Loading branch information...
1 parent de0b7fb commit 334694c6bfb2e2123293a25ad6e75dfa86bb5bd0 Siedrix committed Dec 21, 2011
Showing with 31 additions and 3 deletions.
  1. +11 −0 browser.html
  2. +7 −3 neon.js
  3. +13 −0 node.js
View
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Neon</title>
+ <script src="neon.js" type="text/javascript"></script>
+</head>
+<body>
+ <h1>Neon</h1>
+</body>
+</html>
+
View
@@ -45,7 +45,9 @@
* }
* });
*/
-var Interface = function Interface(nameOrNameSpace, name){
+(function (global){
+
+global.Interface = function Interface(nameOrNameSpace, name){
var nameSpace, interfaceName, factory;
nameSpace = (nameOrNameSpace && name) ? nameOrNameSpace : this;
interfaceName = (nameOrNameSpace && name) ? name :
@@ -59,7 +61,7 @@ var Interface = function Interface(nameOrNameSpace, name){
return factory;
};
-var Module = function Module(nameOrNameSpace, name){
+global.Module = function Module(nameOrNameSpace, name){
var nameSpace, moduleName, factory;
nameSpace = (nameOrNameSpace && name) ? nameOrNameSpace : this;
moduleName = (nameOrNameSpace && name) ? name :
@@ -72,7 +74,7 @@ var Module = function Module(nameOrNameSpace, name){
return factory;
};
-var Class = function Class(classNameOrNameSpace, className){
+global.Class = function Class(classNameOrNameSpace, className){
var nameSpace, newClass, classFactory;
nameSpace = (classNameOrNameSpace && className) ? classNameOrNameSpace : this;
className = (classNameOrNameSpace && className) ? className :
@@ -195,3 +197,5 @@ var Class = function Class(classNameOrNameSpace, className){
return classFactory;
};
+
+}(typeof window === 'undefined' ? exports : window));
View
@@ -0,0 +1,13 @@
+var Neon = require('./neon.js');
+
+console.log('Neon Class :',typeof Neon.Class);
+console.log('Neon Module :',typeof Neon.Module);
+console.log('Neon Interface :',typeof Neon.Interface);
+
+var Class = Neon.Class;
+var Module = Neon.Module;
+var Interface = Neon.Interface;
+
+console.log('Neon Class :',typeof Class);
+console.log('Module :',typeof Module);
+console.log('Interface :',typeof Interface);

0 comments on commit 334694c

Please sign in to comment.