2016-06-10 21:10:32 +02:00
|
|
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
2015-05-02 20:06:57 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
2016-06-10 21:10:32 +02:00
|
|
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
|
|
|
es6id: 14.5.14
|
2015-05-02 20:06:57 +02:00
|
|
|
description: >
|
2017-02-10 16:52:53 +01:00
|
|
|
The prototype of a null-extending class is %FunctionPrototype%, the prototype of
|
|
|
|
its "prototype" property is `null`.
|
2016-06-10 21:10:32 +02:00
|
|
|
info: |
|
|
|
|
Runtime Semantics: ClassDefinitionEvaluation
|
|
|
|
|
2017-02-10 16:52:53 +01:00
|
|
|
[...]
|
2016-06-10 21:10:32 +02:00
|
|
|
5. If ClassHeritageopt is not present, then
|
|
|
|
[...]
|
|
|
|
6. Else,
|
|
|
|
[...]
|
2016-12-21 07:30:06 +01:00
|
|
|
b. Let superclass be the result of evaluating ClassHeritage.
|
2016-06-10 21:10:32 +02:00
|
|
|
[...]
|
2017-02-10 16:52:53 +01:00
|
|
|
e. If superclass is null, then
|
|
|
|
i. Let protoParent be null.
|
|
|
|
ii. Let constructorParent be the intrinsic object %FunctionPrototype%.
|
2016-06-10 21:10:32 +02:00
|
|
|
[...]
|
2015-05-02 20:06:57 +02:00
|
|
|
---*/
|
2016-06-10 21:10:32 +02:00
|
|
|
|
|
|
|
class Foo extends null {}
|
2015-05-02 20:06:57 +02:00
|
|
|
|
|
|
|
assert.sameValue(Object.getPrototypeOf(Foo.prototype), null);
|
|
|
|
assert.sameValue(Object.getPrototypeOf(Foo.prototype.constructor), Function.prototype);
|
2017-02-10 16:52:53 +01:00
|
|
|
assert.sameValue(Foo, Foo.prototype.constructor);
|