Debian Codegraph @

js/src/tests/test262/language/statements/function/S13_A10.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: Function is a data
6 es5id: 13_A10
7 description: Using function as a property of an object
8 ---*/
9
10 function __ziggy__func(){return "ziggy stardust"}
11
12 var __music_box={};
13
14 __music_box.ziggy = __ziggy__func;
15
16 //////////////////////////////////////////////////////////////////////////////
17 //CHECK#
18 if (typeof __music_box.ziggy !== "function") {
19 throw new Test262Error('#1: typeof __music_box.ziggy === "function". Actual: typeof __music_box.ziggy ==='+typeof __music_box.ziggy);
20 }
21 //
22 //////////////////////////////////////////////////////////////////////////////
23
24 //////////////////////////////////////////////////////////////////////////////
25 //CHECK#2
26 if (__music_box.ziggy() !== "ziggy stardust") {
27 throw new Test262Error('#2: __music_box.ziggy() === "ziggy stardust". Actual: __music_box.ziggy() ==='+__music_box.ziggy());
28 }
29 //
30 //////////////////////////////////////////////////////////////////////////////
31
32 reportCompare(0, 0);