summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-586.js
blob: fb50b43e6affa1abb370104fb2fc74b880e6142a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.6-4-586
description: >
    ES5 Attributes - Fail to update value of property into of
    [[Proptotype]] internal property  (JSON)
includes: [propertyHelper.js]
---*/

var data = "data";

Object.defineProperty(Object.prototype, "prop", {
  get: function() {
    return data;
  },
  enumerable: false,
  configurable: true
});
verifyNotWritable(JSON, "prop", "nocheck");

assert(!JSON.hasOwnProperty("prop"));
assert.sameValue(JSON.prop, "data");
assert.sameValue(data, "data");

reportCompare(0, 0);