Debian Codegraph @

js/src/tests/test262/language/expressions/delete/member-computed-reference-null.js

raw
1 // Copyright (C) 2021 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-delete-operator
6 description: Delete Operator throws an error if the base reference is not object-coercible (null).
7 info: |
8 # 12.5.3.2 Runtime Semantics: Evaluation
9 UnaryExpression : delete UnaryExpression
10
11 [...]
12 5. If IsPropertyReference(ref) is true, then
13 a. If IsSuperReference(ref) is true, throw a ReferenceError exception.
14 b. Let baseObj be ? ToObject(ref.[[Base]]).
15 ---*/
16
17 var base = null;
18
19 assert.throws(TypeError, function() {
20 delete base[0];
21 });
22
23 reportCompare(0, 0);