Skip to content

Commit

Permalink
use a json filter to avoid circular references
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Aug 24, 2010
1 parent c2f1a3e commit 03ad996
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shows/page.js
@@ -1,13 +1,13 @@
function(doc, req) {
var code = require("vendor/couchapp/lib/code").ddoc(this),
ddoc_code = JSON.stringify(code);
// top two lines have to come first or else parent references in the ddoc
// which are created by calls to require will break JSON.stringify.
var name, stub, ddoc = this,
mustache = require("vendor/couchapp/lib/mustache"),
wiki = require("lib/wiki"),
data = {
ddoc : ddoc_code,
ddoc : JSON.stringify(require("vendor/couchapp/lib/code").ddoc(ddoc), function(key, value) {
return (key == "parent") ? undefined : value;
}),
docid : JSON.stringify(req.id),
id : req.id,
path : "../page/"+req.id,
Expand Down

0 comments on commit 03ad996

Please sign in to comment.