mirror of
https://github.com/tc39/test262.git
synced 2025-07-01 19:24:42 +02:00
Coverage gaps found by quickjs. Fixes gh-2370
This commit is contained in:
parent
378481b041
commit
accf91c57d
@ -27,6 +27,7 @@ assert.sameValue(delete 0, true, 'delete 0');
|
|||||||
assert.sameValue(delete 1, true, 'delete 1');
|
assert.sameValue(delete 1, true, 'delete 1');
|
||||||
assert.sameValue(delete '', true, 'delete ""');
|
assert.sameValue(delete '', true, 'delete ""');
|
||||||
assert.sameValue(delete 'Test262', true, 'delete "Test262"');
|
assert.sameValue(delete 'Test262', true, 'delete "Test262"');
|
||||||
|
assert.sameValue(delete 'Test262'[100], true, 'delete "Test262"[100]');
|
||||||
assert.sameValue(delete typeof +-~!0, true, 'delete typeof +-~!0');
|
assert.sameValue(delete typeof +-~!0, true, 'delete typeof +-~!0');
|
||||||
assert.sameValue(delete +-~!0, true, 'delete +-~!0');
|
assert.sameValue(delete +-~!0, true, 'delete +-~!0');
|
||||||
assert.sameValue(delete -~!0, true, 'delete -~!0');
|
assert.sameValue(delete -~!0, true, 'delete -~!0');
|
||||||
|
23
test/language/expressions/delete/super-property-method.js
Normal file
23
test/language/expressions/delete/super-property-method.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-delete-operator-runtime-semantics-evaluation
|
||||||
|
description: Attempts to delete super reference property references throws ReferenceError exception
|
||||||
|
features: [class]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
class X {
|
||||||
|
method() { return this; }
|
||||||
|
}
|
||||||
|
|
||||||
|
class Y extends X {
|
||||||
|
method() {
|
||||||
|
delete super.method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const y = new Y();
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, () => {
|
||||||
|
y.method();
|
||||||
|
});
|
@ -2,7 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-delete-operator-runtime-semantics-evaluation
|
esid: sec-delete-operator-runtime-semantics-evaluation
|
||||||
es6id: 12.5.4.2
|
|
||||||
description: SuperReferences may not be deleted
|
description: SuperReferences may not be deleted
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
@ -11,26 +10,13 @@ info: |
|
|||||||
features: [class]
|
features: [class]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var caught;
|
|
||||||
|
|
||||||
class C extends Object {
|
class C extends Object {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
try {
|
delete super.x;
|
||||||
delete super.x;
|
|
||||||
} catch (err) {
|
|
||||||
caught = err;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the "construct" invocation completes and the "this" value is
|
assert.throws(ReferenceError, () => {
|
||||||
// uninitialized, the specification dictates that a ReferenceError must be
|
|
||||||
// thrown. That behavior is tested elsewhere, so the error is ignored (if it is
|
|
||||||
// produced at all).
|
|
||||||
try {
|
|
||||||
new C();
|
new C();
|
||||||
} catch (_) {}
|
});
|
||||||
|
|
||||||
assert.sameValue(typeof caught, 'object');
|
|
||||||
assert.sameValue(caught.constructor, ReferenceError);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user