summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/subclass/superclass-bound-function.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/statements/class/subclass/superclass-bound-function.js')
-rw-r--r--js/src/tests/test262/language/statements/class/subclass/superclass-bound-function.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/subclass/superclass-bound-function.js b/js/src/tests/test262/language/statements/class/subclass/superclass-bound-function.js
new file mode 100644
index 0000000000..2f95cc1ccf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/subclass/superclass-bound-function.js
@@ -0,0 +1,27 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: SuperClass may be a bound function object
+info: |
+ ClassDefinitionEvaluation
+
+ [...]
+ 5. Else,
+ [...]
+ f. Else if IsConstructor(superclass) is false, throw a TypeError exception.
+ g. Else,
+ i. Let protoParent be ? Get(superclass, "prototype").
+ ii. If Type(protoParent) is neither Object nor Null, throw a TypeError exception.
+ iii. Let constructorParent be superclass.
+features: [class]
+---*/
+
+var bound = function() {}.bind();
+bound.prototype = {};
+
+class C extends bound {}
+
+assert.sameValue(Object.getPrototypeOf(new C()), C.prototype);
+
+reportCompare(0, 0);