Skip to content

Commit

Permalink
don't inherit Page from global anymore
Browse files Browse the repository at this point in the history
not needed with simplified lookup of controller functions in
derby-templates that just looks up on current controller, page, and
global
  • Loading branch information
nateps committed Nov 12, 2014
1 parent 6c58022 commit 6c6ce99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions lib/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ function Page(app, model, req, res) {
this._addListeners();
}

// Inherit from the global object so that global functions and constructors are
// available for use as template helpers.
//
// It's important that the page controller doesn't have a parent, since this
// could cause an infinite loop in controller function lookup
Page.prototype = Object.create(global, {parent: {value: null}});

util.mergeInto(Page.prototype, Controller.prototype);

Page.prototype.$bodyClass = function(ns) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"test": "./node_modules/.bin/mocha test/*.mocha.js; ./node_modules/.bin/jshint lib/*.js test/*.js"
},
"dependencies": {
"derby-parsing": "^0.2.0",
"derby-templates": "^0.1.7",
"derby-parsing": "^0.2.2",
"derby-templates": "^0.1.13",
"html-util": "~0.2.1",
"tracks": "^0.5.0",
"racer": "0.6.0-alpha24",
Expand Down

0 comments on commit 6c6ce99

Please sign in to comment.