tor-browser

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

literal-expr-member-expr.js (1005B)


      1 // Copyright (C) 2014 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 TemplateLiteral
      6 info: |
      7    TemplateLiteral : TemplateHead Expression TemplateSpans
      8 
      9    1. Let head be the TV of TemplateHead as defined in 11.8.6.
     10    2. Let sub be the result of evaluating Expression.
     11    3. Let middle be ToString(sub).
     12 ---*/
     13 
     14 var object = {
     15  number: 5,
     16  string: 'stringValue'
     17 };
     18 
     19 assert.sameValue(
     20  `foo ${object.number} bar`, 'foo 5 bar', 'number value property'
     21 );
     22 assert.sameValue(
     23  `foo ${object.string} bar`, 'foo stringValue bar', 'string value property'
     24 );
     25 assert.sameValue(
     26  `foo ${object['string']} bar`,
     27  'foo stringValue bar',
     28  'string value property (single-quote string dereference)'
     29 );
     30 assert.sameValue(
     31  `foo ${object["string"]} bar`,
     32  'foo stringValue bar',
     33  'string value property (double-quote string dereference)'
     34 );
     35 
     36 reportCompare(0, 0);