tor-browser

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

nextkey-is-symbol-throws.js (672B)


      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: 21.1.2.4
      5 description: >
      6  Throws a TypeError if nextKey is Symbol
      7 info: |
      8  21.1.2.4 String.raw ( template , ...substitutions )
      9 
     10  ...
     11  10. Let stringElements be a new List.
     12  11. Let nextIndex be 0.
     13  12. Repeat
     14    a. Let nextKey be ToString(nextIndex).
     15    b. Let nextSeg be ToString(Get(raw, nextKey)).
     16    c. ReturnIfAbrupt(nextSeg).
     17    ...
     18 features: [Symbol]
     19 ---*/
     20 
     21 var obj = {
     22  raw: {
     23    length: 1,
     24    '0': Symbol('')
     25  }
     26 };
     27 
     28 assert.throws(TypeError, function() {
     29  String.raw(obj);
     30 });
     31 
     32 reportCompare(0, 0);