Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/super/prop-expr-cls-key-err.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-super-keyword
5 es6id: 12.3.5
6 description: Abrupt completion from type coercion of property key
7 info: |
8 1. Let propertyNameReference be the result of evaluating Expression.
9 2. Let propertyNameValue be ? GetValue(propertyNameReference).
10 3. Let propertyKey be ? ToPropertyKey(propertyNameValue).
11
12 7.1.14 ToPropertyKey
13
14 1. Let key be ? ToPrimitive(argument, hint String).
15 features: [class]
16 ---*/
17
18 var thrown = new Test262Error();
19 var badToString = {
20 toString: function() {
21 throw thrown;
22 }
23 };
24 var caught;
25 class C {
26 method() {
27 try {
28 super[badToString];
29 } catch (err) {
30 caught = err;
31 }
32 }
33 }
34
35 C.prototype.method();
36
37 assert.sameValue(caught, thrown);