Permalink
Browse files

use a json filter to avoid circular references

  • Loading branch information...
1 parent c2f1a3e commit 03ad99686e4fec679bf771e7f7c73fee8fb67137 @jchris jchris committed Aug 24, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 shows/page.js
View
@@ -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,

0 comments on commit 03ad996

Please sign in to comment.