summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/String/prototype/valueOf/string-primitive.js
blob: 8d951a9cfc5a0a7d5d322a38cf194b28eb358b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-string.prototype.valueof
description: >
  If called on String primitive, returns it
info: |
  String.prototype.valueOf ( )

  1. Return ? thisStringValue(this value).

  thisStringValue ( value )

  1. If Type(value) is String, return value.
---*/

var valueOf = String.prototype.valueOf;

assert.sameValue('str'.valueOf(), 'str');
assert.sameValue(valueOf.call(''), '');

reportCompare(0, 0);