Debian Codegraph @

js/src/tests/test262/language/statements/class/subclass/class-definition-parent-proto-null.js

raw
1 // Copyright (C) 2016 Kevin Gibbons. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-runtime-semantics-classdefinitionevaluation
5 description: A class which extends a constructor with null .prototype is a derived class.
6 ---*/
7
8 var invoked = false;
9 var instance, savedArg;
10
11 function A(arg) {
12 invoked = true;
13 savedArg = arg;
14 this.prop = 0;
15 }
16 A.prototype = null;
17
18 class C extends A {}
19
20 instance = new C(1);
21
22 assert.sameValue(invoked, true);
23 assert.sameValue(savedArg, 1);
24 assert.sameValue(instance.prop, 0);
25
26 reportCompare(0, 0);