mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fixes #2721 -- show error message for naked super
This commit is contained in:
parent
6b79af2b7c
commit
5dea70b82e
2 changed files with 3 additions and 2 deletions
|
@ -39,7 +39,8 @@
|
|||
};
|
||||
|
||||
Scope.prototype.namedMethod = function() {
|
||||
if (this.method.name || !this.parent) {
|
||||
var _ref1;
|
||||
if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) {
|
||||
return this.method;
|
||||
}
|
||||
return this.parent.namedMethod();
|
||||
|
|
|
@ -41,7 +41,7 @@ can get complicated if super is being called from an inner function.
|
|||
function object that has a name filled in, or bottoms out.
|
||||
|
||||
namedMethod: ->
|
||||
return @method if @method.name or !@parent
|
||||
return @method if @method?.name or !@parent
|
||||
@parent.namedMethod()
|
||||
|
||||
Look up a variable name in lexical scope, and declare it if it does not
|
||||
|
|
Loading…
Add table
Reference in a new issue