Skip to content

Commit

Permalink
Another idea for the __define hack syntax. I don't like it.
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebloss committed Mar 4, 2012
1 parent f29b700 commit 81afcca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion win/gel.exe/evals.js
Expand Up @@ -45,7 +45,9 @@ function __define(value) {
__definedVal = value;
};

function __getDefined() {
function __d$(voidArg) {
/// <summary>Returns the __definedVal for a call to an evals exported function.</summary>
/// <param name="voidArg">Place here the call to a NodeScript method such as NodeScript.runInNewContext.</param>
var rval = __definedVal;
__definedVal = null;
return rval;
Expand Down
5 changes: 5 additions & 0 deletions win/gel.exe/gel.js
Expand Up @@ -17,8 +17,13 @@ var global;
startup.globalTimeouts();

var util = NativeModule.require('util');

util.puts("Heloooooooooooooooooooooooooooooooooooo");

for (var i in global) {
console.log('global.' + i + ': ' + typeof global[i] +
(global[i] === null ? ' (null)' : ''));
}
}

startup.globalVariables = function() {
Expand Down
3 changes: 1 addition & 2 deletions win/gel.exe/native_module.js
Expand Up @@ -67,8 +67,7 @@ NativeModule.prototype.compile = function() {
var source = NativeModule.getSource(this.id);
source = NativeModule.wrap(source);

runInThisContext(source, this.filename, true);
var fn = __getDefined();
var fn = __d$(runInThisContext(source, this.filename, true));
fn(this.exports, NativeModule.require, this, this.filename);

this.loaded = true;
Expand Down

0 comments on commit 81afcca

Please sign in to comment.