Debian Codegraph @

js/src/tests/test262/built-ins/eval/length-non-configurable.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 of eval does not have the attribute DontDelete
6 esid: sec-eval-x
7 description: Checking use hasOwnProperty, delete
8 ---*/
9
10 //CHECK#1
11 if (eval.hasOwnProperty('length') !== true) {
12 throw new Test262Error('#1: eval.hasOwnProperty(\'length\') === true. Actual: ' + (eval.hasOwnProperty('length')));
13 }
14
15 delete eval.length;
16
17 //CHECK#2
18 if (eval.hasOwnProperty('length') !== false) {
19 throw new Test262Error('#2: delete eval.length; eval.hasOwnProperty(\'length\') === false. Actual: ' + (eval.hasOwnProperty('length')));
20 }
21
22 //CHECK#3
23 if (eval.length === undefined) {
24 throw new Test262Error('#3: delete eval.length; eval.length !== undefined');
25 }
26
27 reportCompare(0, 0);