From 882bfcada1a33867987a7f3115a87b11e2e9458a Mon Sep 17 00:00:00 2001 From: Phil Gates-Idem Date: Tue, 27 May 2014 00:51:24 -0400 Subject: [PATCH] Adding ability to use custom context class for rendering --- .jshintrc | 5 +++-- lib/raptor-render-context.js | 14 ++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.jshintrc b/.jshintrc index bd10fb4af..a1e7ce8f2 100644 --- a/.jshintrc +++ b/.jshintrc @@ -3,8 +3,8 @@ ], - "globals": { - "define": true, + "globals": { + "define": true, "require": true }, @@ -34,6 +34,7 @@ "eqeqeq": false, "latedef": true, "unused": true, + "strict": false, /* Relaxing options: */ "eqnull": true diff --git a/lib/raptor-render-context.js b/lib/raptor-render-context.js index 1609221ad..b686d99f4 100644 --- a/lib/raptor-render-context.js +++ b/lib/raptor-render-context.js @@ -15,10 +15,10 @@ */ /** * This module provides the runtime for rendering compiled templates. - * - * + * + * *

The code for the Raptor Templates compiler is kept separately - * in the {@link raptor/templating/compiler} module. + * in the {@link raptor/templating/compiler} module. */ var Context = require('./Context'); @@ -30,4 +30,10 @@ exports.enableAsyncStackTrace = function() { Context.INCLUDE_STACK = true; }; -exports.Context = Context; \ No newline at end of file + +exports.setContextClass = function(contextClass) { + exports.Context = Context = contextClass; +}; + +exports.Context = Context; +