Debian Codegraph @

js/src/tests/test262/language/statements/function/S13.2.1_A9.1_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: |
6 When the [[Call]] property for a Function object is called,
7 the body is evaluated and if evaluation result has type "normal", then "undefined" is returned
8 es5id: 13.2.1_A9.1_T1
9 description: >
10 Declaring a function with "function __func()" and no "return" in
11 the function body
12 ---*/
13
14 var x;
15
16 function __func(){
17 x = true;
18 }
19
20 //////////////////////////////////////////////////////////////////////////////
21 //CHECK#1
22 if (__func() !== undefined) {
23 throw new Test262Error('#1: __func() === undefined. Actual: __func() ==='+__func());
24 };
25 //
26 //////////////////////////////////////////////////////////////////////////////
27
28 //////////////////////////////////////////////////////////////////////////////
29 //CHECK#2
30 if (!x) {
31 throw new Test262Error('#2: x === true. Actual: x === '+x);
32 }
33 //
34 //////////////////////////////////////////////////////////////////////////////
35
36 reportCompare(0, 0);