tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

middle-list-one-expr-member-expr.js (1028B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 12.2.8.5
      5 description: MemberExpression in expression position of TemplateMiddleList
      6 info: |
      7    TemplateMiddleList : TemplateMiddle Expression
      8 
      9    1. Let head be the TV of TemplateMiddle as defined in 11.8.6.
     10    2. Let sub be the result of evaluating Expression.
     11    3. Let middle be ToString(sub).
     12    4. ReturnIfAbrupt(middle).
     13 ---*/
     14 
     15 var object = {
     16  number: 5,
     17  string: 'stringValue'
     18 };
     19 
     20 assert.sameValue(
     21  `${0} ${object.number} bar`, '0 5 bar', 'number value property'
     22 );
     23 assert.sameValue(
     24  `${0} ${object.string} bar`, '0 stringValue bar', 'string value property'
     25 );
     26 assert.sameValue(
     27  `${0} ${object['string']} bar`,
     28  '0 stringValue bar',
     29  'string value property (single-quote string dereference)'
     30 );
     31 assert.sameValue(
     32  `${0} ${object["string"]} bar`,
     33  '0 stringValue bar',
     34  'string value property (double-quote string dereference)'
     35 );
     36 
     37 reportCompare(0, 0);