Skip to content

Commit

Permalink
added throw on super undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Polu committed Apr 17, 2012
1 parent 053909c commit 7b7d0fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cell-0.2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/base.js
Expand Up @@ -104,6 +104,8 @@ CELL.method = function(that, name, method, _super) {
if(_super) {
var m = that[name];
_super[name] = function() {
if(typeof m !== 'function')
throw new Error('_super.' + name + '() is not a function');
return m.apply(that, arguments);
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/container.js
Expand Up @@ -49,14 +49,14 @@ CELL.container = function(spec, my) {
var _super = {};
var my = my || {};

my.name = spec.name || '/'; /* the container name */
my.name = spec.name || ''; /* the container name */
my.children = {}; /* cell children, created at build time */

// public
var find; /* find(path); */

// protected
var construct; /* construct(); */
var load; /* load(); */


var that = CELL.emitter({});
Expand Down

0 comments on commit 7b7d0fd

Please sign in to comment.