From b067100d96210d001fc66ec09d950f82fa3862d9 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Fri, 1 Mar 2013 00:06:11 +0700 Subject: [PATCH] Browserify-proof railway init --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 74ab6807..d734fff9 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,10 @@ exports.init = function (rw) { rw.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass}; } var railway = './lib/railway'; - require(railway)(rw); + try { + var init = require(railway); + } catch (e) {} + if (init) init(rw); }; exports.__defineGetter__('version', function () {