Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Function/length/S15.3.5.1_A1_T3.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 The value of the length property is usually an integer that indicates the
7 'typical' number of arguments expected by the function
8 es5id: 15.3.5.1_A1_T3
9 description: >
10 Checking length property of
11 Function("arg1,arg2,arg3","arg1,arg2","arg3", null)
12 ---*/
13
14 var f = new Function("arg1,arg2,arg3", "arg1,arg2", "arg3", null);
15
16 //CHECK#1
17 if (!(f.hasOwnProperty('length'))) {
18 $ERROR('#1: the function has length property.');
19 }
20
21 //CHECK#2
22 if (f.length !== 6) {
23 $ERROR('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
24 }