Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-625gs.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.6-4-625gs
6 description: >
7 Globally declared variable should take precedence over
8 Object.prototype property of the same name
9 ---*/
10
11 Object.defineProperty(Object.prototype,
12 "prop",
13 {
14 value: 1001,
15 writable: false,
16 enumerable: false,
17 configurable: false
18 }
19 );
20 var prop = 1002;
21
22 if (!(this.hasOwnProperty("prop") && prop === 1002)) {
23 throw "this.prop should take precedence over Object.prototype.prop";
24 }