summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/syntax/class-body-has-direct-super-class-heritage.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/statements/class/syntax/class-body-has-direct-super-class-heritage.js')
-rw-r--r--js/src/tests/test262/language/statements/class/syntax/class-body-has-direct-super-class-heritage.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/syntax/class-body-has-direct-super-class-heritage.js b/js/src/tests/test262/language/statements/class/syntax/class-body-has-direct-super-class-heritage.js
new file mode 100644
index 0000000000..4c8a3a1499
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/syntax/class-body-has-direct-super-class-heritage.js
@@ -0,0 +1,25 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 14.5.1
+description: >
+ The opposite of:
+
+ ClassTail : ClassHeritageopt { ClassBody }
+
+ It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
+ 1. Let constructor be ConstructorMethod of ClassBody.
+ 2. If constructor is empty, return false.
+ 3. Return HasDirectSuper of constructor.
+---*/
+class A {}
+class B extends A {
+ constructor() {
+ super();
+ }
+}
+
+
+assert.sameValue(typeof B, "function");
+
+reportCompare(0, 0);