punctuator-decimal-lookahead.js (459B)
1 // Copyright 2019 Google, Inc. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: prod-OptionalExpression 5 description: > 6 ternary operation with decimal does not evaluate as optional chain 7 info: | 8 Punctuators 9 OptionalChainingPunctuator:: 10 ?.[lookahead ∉ DecimalDigit] 11 features: [optional-chaining] 12 ---*/ 13 14 const value = true ?.30 : false; 15 assert.sameValue(.30, value); 16 17 reportCompare(0, 0);