From e3e2a268348b8a2d7669b8dba5ccc65b114ffcea Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Thu, 19 Mar 2015 15:22:38 -0600 Subject: [PATCH] Fixes #50 Initialize the loader after the runtime is fully initialized --- runtime/marko-runtime.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime/marko-runtime.js b/runtime/marko-runtime.js index 23324ac03..b1d8c0d59 100644 --- a/runtime/marko-runtime.js +++ b/runtime/marko-runtime.js @@ -30,11 +30,7 @@ var asyncWriter = require('async-writer'); // that are available in every template (empty, notEmpty, etc.) var helpers = require('./helpers'); -// The loader is used to load templates that have not already been -// loaded and cached. On the server, the loader will use -// the compiler to compile the template and then load the generated -// module file using the Node.js module loader -var loader = require('./loader'); +var loader; // If the optional "stream" module is available // then Readable will be a readable stream @@ -69,7 +65,7 @@ Template.prototype = { if (data.$global) { out.global = extend(out.global, data.$global); - delete data.$global; + delete data.$global; } this._(data, out); @@ -246,3 +242,9 @@ exports.createWriter = function(writer) { exports.helpers = helpers; exports.Template = Template; + +// The loader is used to load templates that have not already been +// loaded and cached. On the server, the loader will use +// the compiler to compile the template and then load the generated +// module file using the Node.js module loader +loader = require('./loader'); \ No newline at end of file