babel/packages/babel-preset-es2015/test/fixtures/traceur/Classes/ExtendNonConstructableFunction.js
2018-03-24 16:22:20 +05:30

12 lines
303 B
JavaScript

expect(function() {
class C extends Math {}
}).toThrow('Super expression must either be null or a function');
expect(function() {
function f() {}
// prototype needs to be an Object or null.
f.prototype = 42;
class C extends f {}
}).toThrow('Object prototype may only be an Object or null');