diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/statements/class/subclass/builtin-objects/Proxy/no-prototype-throws.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/statements/class/subclass/builtin-objects/Proxy/no-prototype-throws.js')
-rw-r--r-- | js/src/tests/test262/language/statements/class/subclass/builtin-objects/Proxy/no-prototype-throws.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/subclass/builtin-objects/Proxy/no-prototype-throws.js b/js/src/tests/test262/language/statements/class/subclass/builtin-objects/Proxy/no-prototype-throws.js new file mode 100644 index 0000000000..c61848395c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/subclass/builtin-objects/Proxy/no-prototype-throws.js @@ -0,0 +1,34 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 14.5.14 +description: The Proxy Object is not subclasseable without a prototype +info: | + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 5. If ClassHeritageopt is not present, then + ... + 6. Else + ... + e. If superclass is null, then + ... + f. Else if IsConstructor(superclass) is false, throw a TypeError exception. + g. Else + ... + ii. Let protoParent be Get(superclass, "prototype"). + iii. ReturnIfAbrupt(protoParent). + iv. If Type(protoParent) is neither Object nor Null, throw a TypeError exception. + + 26.2.1 The Proxy Constructor + + The Proxy constructor is the %Proxy% intrinsic object and the initial value of + the Proxy property of the global object. When called as a constructor it + creates and initializes a new proxy exotic object. Proxy is not intended to be + called as a function and will throw an exception when called in that manner. +---*/ + +assert.throws(TypeError, function() { + class P extends Proxy {} +}); + +reportCompare(0, 0); |