mirror of
https://github.com/tc39/test262.git
synced 2025-05-08 08:50:30 +02:00
This adds tests for implementation bugs in SpiderMonkey [1], plus additional tests for implementation bugs in V8 and JSC. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1723155
32 lines
708 B
JavaScript
32 lines
708 B
JavaScript
// Copyright (C) 2021 André Bargull. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
description: >
|
|
Throws TypeError when attempting to overwrite a private static method.
|
|
esid: sec-privateset
|
|
info: |
|
|
7.3.30 PrivateSet ( P, O, value )
|
|
1. Let entry be ! PrivateElementFind(P, O).
|
|
2. If entry is empty, throw a TypeError exception.
|
|
3. If entry.[[Kind]] is field, then
|
|
...
|
|
4. Else if entry.[[Kind]] is method, then
|
|
a. Throw a TypeError exception.
|
|
5. ...
|
|
|
|
features: [class, class-static-methods-private]
|
|
---*/
|
|
|
|
class C {
|
|
static #m() {}
|
|
|
|
static assign() {
|
|
this.#m = 0;
|
|
}
|
|
}
|
|
|
|
assert.throws(TypeError, function() {
|
|
C.assign();
|
|
});
|