Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add .gitignore and narwhal-v8's bootstap.js

  • Loading branch information...
commit df4bd79759cec9e18902822efe605f4300fdc561 1 parent 64f8533
Devin Torres authored
View
1  .gitignore
@@ -0,0 +1 @@
+bin/*
View
BIN  bin/hemi
Binary file not shown
View
65 bootstrap.js
@@ -0,0 +1,65 @@
+(function (evalGlobal, global) {
+
+ var debug = true;
+
+ var prefix = "";
+ if (typeof NARWHAL_HOME != "undefined") {
+ prefix = NARWHAL_HOME;
+ delete NARWHAL_HOME;
+ } else {
+ print("Warning: NARWHAL_HOME unknown!");
+ }
+
+ var enginePrefix = "";
+ if (typeof NARWHAL_ENGINE_HOME != "undefined") {
+ enginePrefix = NARWHAL_ENGINE_HOME;
+ delete NARWHAL_ENGINE_HOME;
+ } else {
+ print("Warning: NARWHAL_ENGINE_HOME unknown!");
+ }
+
+ var prefixes = [enginePrefix, prefix];
+
+ var _isFile = isFile, _read = read, _print = print;
+ delete read, isFile, print;
+
+ function NativeLoader() {
+ var loader = {};
+ var factories = {};
+
+ loader.reload = function(topId, path) {
+ _print("loading native: " + topId + " (" + path + ")");
+ factories[topId] = requireNative(topId, path);
+ }
+
+ loader.load = function(topId, path) {
+ if (!factories.hasOwnProperty(topId))
+ loader.reload(topId, path);
+ return factories[topId];
+ }
+
+ return loader;
+ };
+
+ eval(_read(prefix + "/narwhal.js"))({
+ global: global,
+ evalGlobal: evalGlobal,
+ engine: 'hemi',
+ engines: ['hemi', 'v8', 'c', 'default'],
+ debug: debug,
+ print: function (string) { _print(String(string)); },
+ evaluate: function (text) {
+ return eval("(function(require,exports,module,system,print){" + text + "/**/\n})");
+ },
+ fs: {
+ read: function(path) { return _read(path); },
+ isFile: function(path) { return _isFile(path); }
+ },
+ prefix: prefix,
+ prefixes: prefixes,
+ loaders: [[".dylib", NativeLoader()]]
+ });
+
+})(function () {
+ return eval(arguments[0]);
+}, this);
View
1  deps/boost
View
4 package.json
@@ -0,0 +1,4 @@
+{
+ "name": "narwhal-v8",
+ "engine": "v8"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.