blob: 8421adb47639f7624221e698690ee0ebe68c3543 (
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
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.4_A1_T3;
* @section: 15.2.4.4;
* @assertion: The valueOf method returns its "this" value;
* @description: "this" value is a string;
*/
//CHECK#1
if (typeof Object.prototype.valueOf !== "function") {
$ERROR('#1: valueOf method defined');
}
var obj=new Object("greenfield");
//CHECK#2
if (typeof obj.valueOf !== "function") {
$ERROR('#2: valueOf method accessed');
}
//CHECK#3
if (obj.valueOf()!=="greenfield") {
$ERROR('#3: The valueOf method returns its this value');
}
|