Permalink
Browse files

Fixes TypeError for classes in FF strict mode.

"Due to the new semantics of JavaScript's strict mode, CoffeeScript no longer guarantees that constructor functions have names in all runtimes. See #2052 for discussion."

jashkenas/coffeescript#2052
  • Loading branch information...
1 parent 57b844f commit 247cd8c6493efbcd239583fcc3749163be1f10a6 @bfanger bfanger committed Aug 29, 2012
Showing with 1 addition and 6 deletions.
  1. +1 −1 src/CoffeeScript/Nodes.php
  2. +0 −5 src/CoffeeScript/yy/Class.php
@@ -62,7 +62,7 @@ static function utility_extends()
. 'function ctor() { '
. 'this.constructor = child; '
. '} '
- . 'ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; '
+ . 'ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; '
. 'return child; '
. '}';
}
@@ -121,11 +121,6 @@ function compile_node($options)
array_unshift($this->body->expressions, $this->ctor);
}
- if ($decl)
- {
- array_unshift($this->body->expressions, yy('Assign', yy('Value', yy('Literal', $name), array(yy('Access', yy('Literal', 'name')))), yy('Literal', "'{$name}'")));
- }
-
$this->body->expressions[] = $lname;
$this->body->expressions = array_merge($this->directives, $this->body->expressions);

0 comments on commit 247cd8c

Please sign in to comment.