babel/test/fixtures/traceur/Classes/ExtendNonConstructableFunction.js
2015-01-04 19:40:09 +11:00

12 lines
294 B
JavaScript

assert.throw(function() {
class C extends Math {}
}, 'Super expression must either be null or a function');
assert.throw(function() {
function f() {}
// prototype needs to be an Object or null.
f.prototype = 42;
class C extends f {}
}, 'super prototype must be an Object or null');