| 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-581 |
| 6 |
description: ES5 Attributes - Fail to add property into object (Number instance) |
| 7 |
includes: [propertyHelper.js] |
| 8 |
---*/ |
| 9 |
|
| 10 |
var data = "data"; |
| 11 |
|
| 12 |
Object.defineProperty(Number.prototype, "prop", { |
| 13 |
get: function() { |
| 14 |
return data; |
| 15 |
}, |
| 16 |
enumerable: false, |
| 17 |
configurable: true |
| 18 |
}); |
| 19 |
var numObj = new Number(); |
| 20 |
|
| 21 |
verifyNotWritable(numObj, "prop", "nocheck"); |
| 22 |
|
| 23 |
assert(!numObj.hasOwnProperty("prop")); |
| 24 |
assert.sameValue(numObj.prop, "data"); |
| 25 |
assert.sameValue(data, "data"); |