tor-browser

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

template-raw-not-object-throws.js (891B)


      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  Returns abrupt completion from ToObject(template.raw).
      7 info: |
      8  21.1.2.4 String.raw ( template , ...substitutions )
      9 
     10  1. Let substitutions be a List consisting of all of the arguments passed to
     11  this function, starting with the second argument. If fewer than two arguments
     12  were passed, the List is empty.
     13  2. Let numberOfSubstitutions be the number of elements in substitutions.
     14  3. Let cooked be ToObject(template).
     15  4. ReturnIfAbrupt(cooked).
     16  5. Let raw be ToObject(Get(cooked, "raw")).
     17  6. ReturnIfAbrupt(raw).
     18 ---*/
     19 
     20 assert.throws(TypeError, function() {
     21  String.raw({
     22    raw: undefined
     23  });
     24 });
     25 
     26 assert.throws(TypeError, function() {
     27  String.raw({
     28    raw: null
     29  });
     30 });
     31 
     32 reportCompare(0, 0);