summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/definition/invalid-extends.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/statements/class/definition/invalid-extends.js')
-rw-r--r--js/src/tests/test262/language/statements/class/definition/invalid-extends.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/definition/invalid-extends.js b/js/src/tests/test262/language/statements/class/definition/invalid-extends.js
new file mode 100644
index 0000000000..3bd1f15781
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/definition/invalid-extends.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2014 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 14.5
+description: >
+ class invalid extends
+---*/
+assert.throws(TypeError, function() {
+ class C extends 42 {}
+});
+
+assert.throws(TypeError, function() {
+ // Function but its .prototype is not null or a function.
+ class C extends Math.abs {}
+});
+
+assert.throws(TypeError, function() {
+ Math.abs.prototype = 42;
+ class C extends Math.abs {}
+});
+delete Math.abs.prototype;
+
+reportCompare(0, 0);