Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/preventExtensions/15.2.3.10-2-1.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es5id: 15.2.3.10-2-1
6 description: >
7 Object.preventExtensions - repeated calls to preventExtensions
8 have no side effects
9 ---*/
10
11 var obj = {};
12 var testResult1 = true;
13 var testResult2 = true;
14
15 var preCheck = Object.isExtensible(obj);
16
17 Object.preventExtensions(obj);
18 testResult1 = Object.isExtensible(obj);
19 Object.preventExtensions(obj);
20 testResult2 = Object.isExtensible(obj);
21
22 assert(preCheck, 'preCheck !== true');
23 assert.sameValue(testResult1, false, 'testResult1');
24 assert.sameValue(testResult2, false, 'testResult2');