Remove return statement on auto-generated constructors

This commit is contained in:
Demian Ferreiro
2012-10-28 03:56:46 -03:00
parent 35787ef79b
commit e46b129c4f
3 changed files with 13 additions and 9 deletions

View File

@@ -595,11 +595,6 @@ test "#1813: Passing class definitions as expressions", ->
eq result, B
test "#1966: external constructors should produce their return value", ->
ctor = -> {}
class A then constructor: ctor
ok (new A) not instanceof A
test "#1980: regression with an inherited class with static function members", ->
class A
@@ -676,3 +671,14 @@ test "#2052: classes should work in strict mode", ->
class A
catch e
ok no
test "#2359: instanceof should work when extending native objects", ->
class MyError extends Error
ok new MyError instanceof MyError
test '#2359: external constructors returning "other typed" objets', ->
ctor = -> {}
class A then constructor: ctor
ok new A instanceof A
ok new ctor not instanceof A
ok new ctor not instanceof ctor