Debian Codegraph @

js/src/tests/test262/built-ins/String/S9.8_A1_T1.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: Result of ToString conversion from undefined value is "undefined"
6 es5id: 9.8_A1_T1
7 description: >
8 Undefined values is undefined, void 0 and eval("var x"). Use
9 explicit transformation
10 ---*/
11
12 // CHECK#1
13 if (String(undefined) !== "undefined") {
14 throw new Test262Error('#1: String(undefined) === "undefined". Actual: ' + (String(undefined)));
15 }
16
17 // CHECK#2
18 if (String(void 0) !== "undefined") {
19 throw new Test262Error('#2: String(void 0) === "undefined". Actual: ' + (String(void 0)));
20 }
21
22 // CHECK#3
23 if (String(eval("var x")) !== "undefined") {
24 throw new Test262Error('#3: String(eval("var x")) === "undefined" . Actual: ' + (String(eval("var x"))));
25 }
26
27 reportCompare(0, 0);