summaryrefslogtreecommitdiff
path: root/test/built-ins/String/prototype/toString/S15.5.4.2_A3_T1.js
blob: dfa848162597bf3f29698fe4663368cb1b078962 (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
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: String.prototype.toString() is equal String.prototype.valueOf()
es5id: 15.5.4.2_A3_T1
description: >
    Create new String() with various arguments and compare returned
    results of toString() and valueOf()
---*/

//CHECK#1
var str = new String();
if (!(str.valueOf() == str.toString()))
  $ERROR('#1: str = new String(),str.valueOf() == str.toString()');

//CHECK#2
str = new String(true);
if (!(str.valueOf() == str.toString()))
  $ERROR('#2: str = new String(true),str.valueOf() == str.toString()');

//CHECK#3
str = new String(false);
if (!(str.valueOf() == str.toString()))
  $ERROR('#3: str = new String(false),str.valueOf() == str.toString()');

//CHECK#4
str = new String(Math.PI);
if (!(str.valueOf() == str.toString()))
  $ERROR('#4: str = new String(Math.PI),str.valueOf() == str.toString()');