summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/String/raw/return-empty-string-if-length-is-negative-infinity.js
blob: 099e52e5d0911c6d861a0b9257bd2f076bdc3f0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.1.2.4
description: >
  Returns empty string if template.raw.length is -Infinity
info: |
  21.1.2.4 String.raw ( template , ...substitutions )

  ...
  7. Let literalSegments be ToLength(Get(raw, "length")).
  8. ReturnIfAbrupt(literalSegments).
  9. If literalSegments ≤ 0, return the empty string.
  ...
---*/

var result = String.raw({
  raw: {
    length: -Infinity
  }
});

assert.sameValue(result, '');

reportCompare(0, 0);