prop-dot-cls-null-proto.js (1164B)
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: > 7 SuperProperty evaluation when the "home" object's prototype is not 8 object-coercible. 9 info: | 10 1. Let propertyKey be StringValue of IdentifierName. 11 2. If the code matched by the syntactic production that is being evaluated is 12 strict mode code, let strict be true, else let strict be false. 13 3. Return ? MakeSuperPropertyReference(propertyKey, strict). 14 15 12.3.5.3 Runtime Semantics: MakeSuperPropertyReference 16 17 1. Let env be GetThisEnvironment( ). 18 2. If env.HasSuperBinding() is false, throw a ReferenceError exception. 19 3. Let actualThis be ? env.GetThisBinding(). 20 4. Let baseValue be ? env.GetSuperBase(). 21 5. Let bv be ? RequireObjectCoercible(baseValue). 22 features: [class] 23 ---*/ 24 25 var caught; 26 class C extends null { 27 method() { 28 try { 29 super.x; 30 } catch (err) { 31 caught = err; 32 } 33 } 34 } 35 36 C.prototype.method(); 37 38 assert.sameValue(typeof caught, 'object'); 39 assert.sameValue(caught.constructor, TypeError); 40 41 reportCompare(0, 0);