summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/annexB/built-ins/escape/argument_types.js
blob: cb046774450c4ad093306849e05e7918020b62ad (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
26
27
28
29
30
31
32
33
34
35
// Copyright (C) 2020 Qu Xing. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-escape-string
description: Input is a null, undefined, boolean or Number
info: |
    B.2.1.1 escape ( string )

    1. Let string be ? ToString(string).
    ...
---*/

assert.sameValue(escape(null), 'null');

assert.sameValue(escape(undefined), 'undefined');

assert.sameValue(escape(), 'undefined');

assert.sameValue(escape(true), 'true');

assert.sameValue(escape(false), 'false');

assert.sameValue(escape(-0), '0');

assert.sameValue(escape(0), '0');

assert.sameValue(escape(1), '1');

assert.sameValue(escape(NaN), 'NaN');

assert.sameValue(escape(Number.POSITIVE_INFINITY), 'Infinity');

assert.sameValue(escape(Number.NEGATIVE_INFINITY), '-Infinity');

reportCompare(0, 0);