Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Function/length/S15.3.5.1_A2_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: the length property does not have the attributes { DontDelete }
6 es5id: 15.3.5.1_A2_T1
7 description: >
8 Checking if deleting the length property of
9 Function("arg1,arg2,arg3", null) succeeds
10 ---*/
11
12 var f = new Function("arg1,arg2,arg3", null);
13
14 //CHECK#1
15 if (!(f.hasOwnProperty('length'))) {
16 $ERROR('#1: the function has length property.');
17 }
18
19 //CHECK#2
20 if (!delete f.length) {
21 $ERROR('#2: the function.length property does not have the attributes DontDelete.');
22 }
23
24 //CHECK#3
25 if (f.hasOwnProperty('length')) {
26 $ERROR('#3: the function.length property does not have the attributes DontDelete.');
27 }
28
29 //CHECK#4
30 if (f.length === 3) {
31 $ERROR('#4: the length property does not have the attributes { DontDelete }');
32 }