Update to js_template.git commit e998e98, (env, out, get) to (_env, _out, _req)
authorNick Downing <downing.nick@gmail.com>
Sun, 14 Oct 2018 23:22:07 +0000 (10:22 +1100)
committerNick Downing <downing.nick@gmail.com>
Sun, 14 Oct 2018 23:41:04 +0000 (10:41 +1100)
resources.js
site.js

index 5669e2d..313d774 100644 (file)
@@ -29,7 +29,7 @@ let get_jst = path => build_cache_js.get(
   path,
   async result => {
     console.log('compiling', path)
-    result.value = await js_template(path, '_env,_out,_get')
+    result.value = await js_template(path)
   }
 )
 
diff --git a/site.js b/site.js
index 0b247a5..77cd054 100644 (file)
--- a/site.js
+++ b/site.js
@@ -126,7 +126,7 @@ let app = async (site, site_root, req, res, protocol) => {
       temp = page + '.jst'
       try {
         let buffers = []
-        let env = {
+        let _env = {
           cookies: cookie.parse(req.headers.cookie || ''),
           lang: 'en',
           method: req.method,
@@ -150,8 +150,8 @@ let app = async (site, site_root, req, res, protocol) => {
           site: site,
           site_root: site_root
         }
-        let out = text => {buffers.push(Buffer.from(text))}
-        let get = async (path, type) => {
+        let _out = text => {buffers.push(Buffer.from(text))}
+        let _req = async (path, type) => {
           path = (
             path.length > 0 && path.charAt(0) === '/' ?
             site_root :
@@ -159,7 +159,7 @@ let app = async (site, site_root, req, res, protocol) => {
           ) + path
           switch (type) {
           case undefined:
-            return /*await*/ (await resources.get_jst(path))(env, out, get)
+            return /*await*/ (await resources.get_jst(path))(_env, _out, _req)
           case 'email':
             return /*await*/ resources.get_email(path)
           case 'jst':
@@ -173,7 +173,7 @@ let app = async (site, site_root, req, res, protocol) => {
           }
           assert(false)
         }
-        await get(temp)
+        await _req(temp)
         let data = Buffer.concat(buffers)
         console.log(
           site,