diff --git a/test/language/expressions/delete/non-reference-return-true.js b/test/language/expressions/delete/non-reference-return-true.js index 6fa643f32f..6c2f943282 100644 --- a/test/language/expressions/delete/non-reference-return-true.js +++ b/test/language/expressions/delete/non-reference-return-true.js @@ -27,6 +27,7 @@ assert.sameValue(delete 0, true, 'delete 0'); assert.sameValue(delete 1, true, 'delete 1'); assert.sameValue(delete '', true, 'delete ""'); 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 +-~!0, true, 'delete +-~!0'); assert.sameValue(delete -~!0, true, 'delete -~!0'); diff --git a/test/language/expressions/delete/super-property-method.js b/test/language/expressions/delete/super-property-method.js new file mode 100644 index 0000000000..31157a778a --- /dev/null +++ b/test/language/expressions/delete/super-property-method.js @@ -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(); +}); diff --git a/test/language/expressions/delete/super-property.js b/test/language/expressions/delete/super-property.js index 4f4fa00144..cd72fbe427 100644 --- a/test/language/expressions/delete/super-property.js +++ b/test/language/expressions/delete/super-property.js @@ -2,7 +2,6 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-delete-operator-runtime-semantics-evaluation -es6id: 12.5.4.2 description: SuperReferences may not be deleted info: | [...] @@ -11,26 +10,13 @@ info: | features: [class] ---*/ -var caught; - class C extends Object { constructor() { super(); - try { - delete super.x; - } catch (err) { - caught = err; - } + delete super.x; } } -// When the "construct" invocation completes and the "this" value is -// 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 { +assert.throws(ReferenceError, () => { new C(); -} catch (_) {} - -assert.sameValue(typeof caught, 'object'); -assert.sameValue(caught.constructor, ReferenceError); +});