rhs-yield-absent-non-strict.js (918B)
1 // Copyright 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 description: Parsing observes the `Yield` production parameter when absent (without strict mode) 6 info: | 7 Syntax 8 RelationalExpression[In, Yield, Await]: 9 [...] 10 [+In] RelationalExpression[+In, ?Yield, ?Await] in ShiftExpression[?Yield, ?Await] 11 12 [...] 13 14 1. Let lref be the result of evaluating RelationalExpression. 15 2. Let lval be ? GetValue(lref). 16 3. Let rref be the result of evaluating ShiftExpression. 17 4. Let rval be ? GetValue(rref). 18 5. If Type(rval) is not Object, throw a TypeError exception. 19 6. Return ? HasProperty(rval, ? ToPropertyKey(lval)). 20 esid: sec-relational-operators 21 flags: [noStrict] 22 ---*/ 23 24 var yield; 25 26 yield = {'': 0}; 27 assert.sameValue('' in (yield), true); 28 29 yield = {}; 30 assert.sameValue('' in (yield), false); 31 32 reportCompare(0, 0);