diff options
Diffstat (limited to 'test/built-ins/Object/defineProperty/15.2.3.6-4-12.js')
-rw-r--r-- | test/built-ins/Object/defineProperty/15.2.3.6-4-12.js | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-12.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-12.js index ecc53f25a..b189fc5c6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-12.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-12.js @@ -12,31 +12,24 @@ description: > non-configurable data properties to accessor properties ---*/ -var o = {}; + var o = {}; -// create a data valued property; all other attributes default to false. -var d1 = { - value: 101, - configurable: false -}; -Object.defineProperty(o, "foo", d1); + // create a data valued property; all other attributes default to false. + var d1 = { value: 101, configurable: false }; + Object.defineProperty(o, "foo", d1); -// changing "foo" to be an accessor should fail, since [[Configurable]] -// on the original property will be false. + // changing "foo" to be an accessor should fail, since [[Configurable]] + // on the original property will be false. -// dummy getter -var getter = function() { - return 1; -} + // dummy getter + var getter = function () { return 1; } -var desc = { - get: getter -}; + var desc = { get: getter }; assert.throws(TypeError, function() { - Object.defineProperty(o, "foo", desc); + Object.defineProperty(o, "foo", desc); }); -// the property should remain a data valued property. -var d2 = Object.getOwnPropertyDescriptor(o, "foo"); + // the property should remain a data valued property. + var d2 = Object.getOwnPropertyDescriptor(o, "foo"); assert.sameValue(d2.value, 101, 'd2.value'); assert.sameValue(d2.writable, false, 'd2.writable'); assert.sameValue(d2.enumerable, false, 'd2.enumerable'); |